26.04.2015 Views

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• Do not add your User.config file to source control. In this way, each developer and<br />

the test team can explicitly bind to specific URLs by using their own User.config<br />

files. Source control may contain other User.config files, for example, for testing and<br />

for production. These files should be managed by the users responsible for managing<br />

the testing and production environments. These test and production User.config files<br />

should not be stored as part of the Web service projects but should be in different<br />

areas of the source control system.<br />

• Store a global User.config file in source control. This could either contain only the<br />

root element (no element) or it could specify the default location of the<br />

Web service. The User.config file must be present for the configuration system to<br />

work.<br />

Tip: By default, the user configuration file is automatically added to source control when<br />

you add the solution. To prevent this, when you first check in the file, clear the<br />

User.config file check box. You can then right-click on the file in Solution Explorer and<br />

select the Under Pending Changes option to ensure that the file is subject to source<br />

control.<br />

Important: If the User.config file that specifies the URL only contains the root element<br />

and there is no setting element in the User.config, then the Web service proxy uses its<br />

default value for the URL. This default value is hard coded into the proxy in a file named<br />

Settings.Designer.cs. The value is specified as a DefaultValueSettings attribute and<br />

looks like the following<br />

[global::System.Configuration.DefaultSettingValueAttribute("http://localhost/webservice/Service.asmx")]<br />

Important: For Web applications that use a user configuration file, any changes made to<br />

the file result in the Web application being automatically recycled by default. If you do<br />

not want to recycle the application when a value changes, add the<br />

restartOnExternalChanges="false" attribute to the configuration section definition as<br />

follows:<br />

<br />

<br />

<br />

<br />

<br />

If you add this attribute to the configuration section in the Web.config file then changes<br />

to the external User.config configuration file do not cause the Web application to recycle.<br />

However, those changes are still visible to the application.<br />

It is important to understand that if you are using this mechanism then the User.config<br />

file must be present. Somebody must be responsible for ensuring the environment is

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!