Tips & Tricks: Web Server Settings for Web Application Projects now can be stored per user as well as per project

Tips & Tricks: Web Server Settings for Web Application Projects now can be stored per user as well as per project

  • Comments 6

Web server settings, which are accessible inside Web Application Projects (WAPs) property pages (Web section)  allow you to specify settings associated to to Visual Studio Development Server or IIS.  Many a times in a team development environment it is preferred that these settings are shared across the teams providing consistency; at the same time many other teams prefer that these settings be developer specific.

To support both of these scenarios in Visual Studio 2008 the web server settings now has an additional checkbox as highlighted below:

image 

By default this check box comes checked and it implies that these settings will be stored in the project file (i.e. .csproj or .vbproj) and when opened in an XML editor will look as below :

image

When the check box above is unchecked then the settings are transferred to .csproj.user / .vbproj.user file located in the project folder and "SaveServerSettingsInUserFile" node value is changed to True in the project file...  This setting is especially useful when a team wants to allow per developer settings while checking in the project files in a source control system like TFS or VSS.

If you are using Visual Studio 2005 then we have created a hotfix to support this model. The explanation above still holds true for VS 2005, although in VS 2005 you will not have the property pages checkbox to make the change to "SaveServerSettingsInUserFile" property.  You will still be able to make the change manually in .csproj and .vbproj file.  You can read more about this in the KB Article 942844.   Hope this will help...

Vishal R. Joshi | Program Manager | Visual Studio Web Developer

Leave a Comment
  • Please add 5 and 2 and type the answer here:
  • Post
  • You've been kicked (a good thing) - Trackback from DotNetKicks.com

  • Great feature! And way too easy to miss as I have...

    This will come in very handy in a number of multi-developer scenarios. It would be cool if there was broader support for this sort of thing in general even for things like web.config where a .user file would override the web.config settings in the same place so you can deal with things like ConnectionStrings, AppSettings etc. in a user specific way. This has traditionally been one of the main things I've seen getting hung up on for source control.

  • Hi Rick...

    You suggested

    >>>>> "This will come in very handy in a number of multi-developer scenarios. It would be cool if there was broader support for this sort of thing in general even for things like web.config where a .user file would override the web.config settings in the same place so you can deal with things like ConnectionStrings, AppSettings etc. in a user specific way"

    web.config is used when your application runs, it is not specifically just a IDE feature...  hence trying to remove sections of web.config into user file is difficult... Although the spirit of your suggestion is very valuable that we indeed need to be able to allow replacement of web.config sectons per user...  We will definitely consider this for future versions of visual studio...  In the meantime I would recommend looking at Web Deployment Projects which have a specific feature around config replacement...  You can find more ifnormation at the linked URL on this comment...

    -Vishal

  • I just arrived back from my trip from Asia, and decided to celebrate (since I'm jet-lagged and can't

  • Links 24/Jan: ASP.NET, ASP.NET AJAX, Visual Studio, .NET, IIS

  • Hi,

    I am new to .NET. I have developed a web application in C#, but it is giving a problem when more than a single user tries to access the same resource simultaneously.

    How can I solve this?

    Current Situation:

    I am using SqlHelper.cs

    Error:

    Exception Details: System.InvalidOperationException: Internal connection fatal error.

    Source Error:

    Line 413: {

    Line 414: ReaderTrans.Close();

    Line 415: ConnectTrans.Close();

    Line 416: }

    Line 417: return returnArr;

    Source File: C:\Inetpub\wwwroot\Electricity\Classes\bislogic.cs

    Function:

    I am using the foll function:

    ReaderTrans = SqlHelper.ExecuteReader(ConnectTrans,sp_name,sp_parpopmajor);

    if (ReaderTrans.HasRows)

    while (ReaderTrans.Read())

    {

      while (i < ReaderTrans.FieldCount)

       {

     if (ReaderTrans.GetFieldType (i) == typeof(System.DateTime))

    returnArr[i] = ReaderTrans.GetDateTime(i).ToString("dd-MMM-yyyy");

    else

    returnArr[i] = ReaderTrans[i].ToString();

    i=i+1;

    }

    }

Page 1 of 1 (6 items)