Quantcast
Channel: Configuration and Deployment
Viewing all 3561 articles
Browse latest View live

Refactoring Web.config

$
0
0

Hello,

I've been working on an ASP.NET MVC 4 project for some months now, and it's been growing in size. Everything I know today about ASP.NET MVC comes from developing this project and because of that the project really needs a big refactoring.

To start, I've been cleaning my web.config file, that was clustered with stuff I didn't know what was the purpose. But, I still have some doubts about some of the things that are there:

1. What's the purpose of this? I know I use Telerik, but I don't know why may I need that reference in the Web.Config. I remove it and everythins seems to work just fine.

<httpHandlers><add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" /></httpHandlers>

2. On my <system.webServer> I have this, and I also don't know what's the purpose if whether I can just remove it or not.

<urlCompression doStaticCompression="true" doDynamicCompression="true" /><validation validateIntegratedModeConfiguration="false" /><handlers><remove name="asset" /><add name="asset" preCondition="integratedMode" verb="GET,HEAD" path="asset.axd" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" /><remove name="ExtensionlessUrlHandler-Integrated-4.0" /><remove name="OPTIONSVerbHandler" /><remove name="TRACEVerbHandler" /><add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /></handlers>

3. Is there a way to put all runtime assembly bindings in an external config file? When I do it like:

<runtime configSource="Config\runtime.config" />

I get the following error:

Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxx' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I understand that some things may seem basic but I want to understand everything I have on my project and do things right this time. Thanks!


Not able to run Website on the server - IIS 7

$
0
0

It works fine on my local machine but gives an authentication error when setup on the server.  What an I missing on the server?

The IIS is setup with Windows Authentication "Enabled" and the Anonymous is "Disabled" and the web.config has the following:

<authorization>
<allow users="*" />
</authorization>

<identity impersonate="true" />

Deploying asp.net application - issue

$
0
0

Hello,

I am trying to deploy an application developed with Visual Studio 2010 to a new in-house IIS 8.5, I have followed all the procedures to deploy the application
-Firewall configuration (open the port 8172)
-I have created a deployment user also granted access to the application folder in the server.
-I have installed the WEB DEPLOY 3.6 on the server

but every time I try to publish the application I got the following error message

Error    1    Web deployment task failed.(Could not complete the request to remote agent URL 'http://192.168.1.57:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE'.)
This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server.
Error details:
Could not complete the request to remote agent URL 'http://192.168.1.57:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE'.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host      

Please if you believe more information is required to troubleshoot the issue, I will appreciate let me know I will try to provide all the information needed.

Any idea about how to fix the issue will be greatly appreciated

Thanks in advance for the help.

URL Redirection Rule in Web.config File

$
0
0

I'm working on a 301 redirect rule that is suppossed to work like this:
/(A(kdkeidks))/abc/abc/page.aspx?parm=abc&parm=123 should flip to /result

so that means that www.domain.com/(A(kdkeidks))/abc/abc/page.aspx?parm=abc&parm=123 should be www.domain.com/result

This web.config value below doesn't work because somehow it doesn't like the extra parentheses in the URL. I need to find a way to be able to handle this, including these characters on the domain "?" and "&".

<rule name="URLRedirectionRule" stopProcessing="true">
<match url="(.*)" />
      <conditions>
               <add input="{URLRedirectionProvider:{URL}}" pattern="(.+)" />
       </conditions>
<action type="Redirect" url="{C:1}" appendQueryString="true" />
</rule>

Any feedback is greatly appreciated.

Pages Slow To Load

$
0
0

I use Chrome as my browser and in the code behind I have a few calls to SQL Queries.  I used StopWatch class to determine the time it takes to run the SQL Queries and one was 12 seconds, and the other was 4, so I know that is not the slowdown.

What should I do to find out what is causing my pages to have a delay in load time?  This is an internal web forms IIS hosted app, no internet access.

Session error when migrating .net app from server 2003 to 2008

$
0
0

Hello,

We are migrating an ASP.Net app from Win2003 server to Win2012R2 and we get the following error: "Session state is not available in this context"

session state eror

We already tried turning the sessionState on of with <page enableSessionState="true/false"/> but is has no impact.

The funny thing is that we are able to run the app on one Win7 machine - with IIS 7.5 - with no issues. However on the server it doesn't work and neither on two other win7 machines. We tried to compare every possible configuration we could think of but with no luck.

Any guidance to how this can be fixed would be very appreciated.

Thank you,

Ken

.NET 4.5.2 Question

$
0
0

Hello, I am using Visual Studio 2015 with a target framework 4.5.2. The web server is .NET 4.0 framework. We are hesitate to upgrade the web server to 4.5.2 since it may turn into a disaster to other .net applications running on the web server. Any advice on how to handle the situation?

Is it possible to use domain account to connect with SQL Server while remain using normal account to access IIS in web.config

$
0
0

Hello everyone! I am totally a newbie in this forum. Laughing

Background of my ASP.NET environment:

IIS 7.5 on Windows 2008R2 Web Server

MS SQL Server 2008R2 on Windows 2008R2 Enterprise Server

I have just developed a ASP.NET application using .NET 4.5 framework and would like to use my existing domain account to connect with the SQL Server. However, I would like to use normal account (which should be something like web$ account) to connect with IIS. Is that possible? I have read the recommendations from the web saying I have to use "Impersonation" feature in the web.config. I don't really like to grant my domain account access right in the IIS with a couple of folders custom access right.

My question is, is it possible for me to connect to the SQL Server using domain account while using normal account to access IIS? It seems to me the impersonation feature will use that domain account to access the IIS and it creates more work for me to grant access right in IIS.Frown

I hope you guys can drop me a line if you would like to share with me your precious experience regarding this. And, I am more than willing to explain a little bit more if you don't get my idea. :P


Migration from Team Foundation Server 2013 to Team Foundation Server 2015

$
0
0

Hello Team,

Is anybody had migrate from TFS 2013 to 2015 ? Please share key notes to taking consideration while migration.

It would be grate if you can share your thoughts.

Thanks,

Deploying an Application - membership Issue

$
0
0

Hello All,

I have created an web Application using VS2010 ASP.NET, the application use membership Databases.
The application has been successfully deployed and I have make sure the Membership Db (ASPNETDB.mdf)  has been properly copied  to the folder APP_DATA on my web server.

At the time that I want to login on my web application as soon as I put the username and Password I get and error

A NETWORK - RELATED OR INSTANCE-SPECIFIC ERROR OCCURRED WHILE ESTABLISHING A CONNECTION TO SQL SERVER THE SERVER WAS NOT FOUND OR WAS NOT ACCESSIBLE, VERIFY THAT THE INSTANCE NAME IS CORRECT AND THAT SQL SERVER IS CONFIGURED TO ALLOW REMOTE CONNECTIONS (provider : SQL NETWORK INTERFACe, error 26 - ERROR LOCATIONG SERVER / INTANCE SPECIFIED)

I have double checked my connection string, and it is as follows

Data Source=192.168.1.5;Initial Catalog=master;User ID=sa;Password=XXXXXXXXXXX

on the MY WEB SERVER I have make sure the SQL server is listening the port 1433 and also allow remote connections, the SQL Browser services is running automatically.

Question,

I  have the impression that the application doesn't know where to find the membership DB

do I have To create a connection string also for the membership database specifying it is located on the APP_DATA FOLDER?

Sorry this is the first time I work with membership databases and it is a little confusing.

Any comment or suggestion will be greatly appreciate.

Thank so much.

 

MVC5 Does not deploy APP_CODE object

$
0
0

VS 2013, MVC5, using File Path publish from Visual Studio.

I have a class in APP_CODE that creates a graphic (Statusbar.cs)

It works while debugging on my desktop.

When I publish and open the site in my browser, I get the "broken image" icon, AND when I right click and "View Image", I get a 404 not found.

When I try to put the APP_CODE folder on the webserver, the whole site crashes.

The build settings for this .cs file are "Compile", "Do Not Copy": though I have tried "copy if newer". 

Picking anything other than "Compile" seems to make the class disappear from my app (intellisense will not find it, it raises build errors).

This *must* be a deploy issue, because it works fine here on my desktop.

It might be some weird permissions issue, or maybe the webserver is missing some library that helps it encode PNGs or something.

Calling a webpage using download string method( Exception calling "DownloadString" with "1" argument(s): "URI formats are not supported.")

$
0
0

Hi All,

I have a hosted an Asp.net application on GoDaddy. I want to schedule some email alerts at a specific time, for that I have written code for sending Email Alerts in an aspx page.  I am calling this page through the Godaddy Scheduler using the below credentials

ASPX Files

TypePath
ExecutableC:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Argument-c "(new-object system.net.webclient).downloadstring('http://[domain.tld]\[path]\[file_name]')"

My arguments are as below to call the page 

Executable : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Argument : -c "(new-object system.net.webclient).downloadstring('http://mydomainname.biz\MMM\EmailAlerts.aspx')"

But its giving error after scheduler is scheduling the alerts as 


At line:1 char:1
+ (new-object system.net.webclient).downloadstring('http://mydomainname.biz\MMM\Emai ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException

Please let me know where I am making a mistake. Any help is appreciated.

Regards,

Noor

How to fix the problem? Tried to publish site

$
0
0

Using VS2010 I get the following when trying to publish the site on domain i have bought.

Warning 1 The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: AjaxControlToolkit, Version=4.1.40412.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e. The dependencies are: System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly.

Can someone explain and let me know how to fix that?

webresource.axd takes Longer to Load and Gives “Err_Connection_Reset”

$
0
0

My Application (ASP.NET, C#, Dotnet Framework 3.5) hosted at data center of my organization is having problem of slowness.

Upon some investigation, I came to know that webresource.axd is taking more then 45 second to load but still fails and throw "Err_Connection_Reset" error.

Loading Timeline using Chrom

I did some search upon net and found the Compilation debug="true" in web.config could reduce performance but setting it to false also didn't help.

Currently, System is working fine when being accessed inside the organization network (Intranet OR Internet) but problem persists when using an external connection.

After publishing asp.net site

$
0
0

Hi,

After I published my site and DB, I got empty tables so the membership users are gone! How to retrieve them from my local DB or add new ones?


Error - connection string after publishing a site

$
0
0

Hi,

After publishing ,y site with hosting company, when i try to login on my own login page .aspx i am receiving this error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

then points to login.aspx code:

Line 23:     {
Line 24: 
Line 25:         if (Membership.ValidateUser(Login1.UserName, Login1.Password))
Line 26:         {
Line 27:             //Perform setting cookie information

But the bigger problem is, sometimes it brings the above error and sometimes it loads the page! Is there a reason for this behavior? Also to note, this behavior is only happening on machines (desktops and laptops), on the other hand, mobiles, they always get the above error.

I am just pointing out something, is it because my sql server is on my machine and i need to make a connection from my hosting site or is there something else that is causing this?

Thanks,

Create separate assembly for each page in TFS Build 2012 defination

$
0
0

I am working on creating build from TFS 2012. I am able to generate build from TFS build templates but problem is that my website(ASPX pages), I am using after generating build is not creating separate dll for individual page.

But If I generate build from VS2012 I can generate build with separate assembly for individual pages.I can see this option when I click on publish and configure.

But how to have same option in Tfs Build templates ?? I have searched for MSbuild arguments and didn't find anything related to that

Cannot open database "database" requested by the login. The login failed. Login failed for user 'xxx\xxx$'

$
0
0

I am getting the following error when I attempt to access my application after deploying to a test web server. I am accessing using Windows Authentication

Cannot open database "databaseName" requested by the login. The login failed.
Login failed for user 'xxx\xx$'

Here is my connectionstring:

<add name="NSEntities" connectionString="metadata=res://*/Models.NS.csdl|res://*/Models.NS.ssdl|res://*/Models.NS.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DDT;initial catalog=NS;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

I do not get the error on my local machine or production server. Any ideas??

Web.Config and Transformations.

$
0
0

We have just started to use Octopus and a deployment method.

One of our configuration managers has updated one of the web.config files to use variable substitution: http://docs.octopusdeploy.com/display/OD/Substitute+Variables+in+Files

Should this be completed within the transformation config file?

Thus the substitution should be applied to the web.test.config file, not the web.config file?

Format of the initialization string does not conform to specification starting at index 0.

$
0
0

I'm working in MVC and Azure and I made a change to a controller (not the web.config) and something must have happened to my connection string as I get the error:

Format of the initialization string does not conform to specification starting at index 0.

This is my connection string:

<connectionStrings><add name="MyDbEntities" connectionString="metadata=res://*/Infrastructure.MyDbModel.csdl|res://*/Infrastructure.MyDbModel.ssdl|res://*/Infrastructure.MyDbModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=mydb.database.windows.net;initial catalog=Mydb;user id=myusername;password=mypassword;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>

I know this error usually means a typo in the string or something but any ideas?

Thanks in advance
Adam

Viewing all 3561 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>