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.

Specify a Web Service URL in a user configuration file<br />

When you first add a Web reference, the App.config file looks like the following:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

http://localhost/someservice/Service.asmx<br />

<br />

<br />

<br />

<br />

This file has a new configuration section that contains the address of the Web service that<br />

<strong>Visual</strong> <strong>Studio</strong> found when generating this proxy.<br />

To create a User.config file<br />

1. In Solution Explorer, right-click the project that contains the Web service reference,<br />

point to Add, and then click New Item.<br />

2. Select Application Configuration File, change the name to User.config, and then<br />

click Add.<br />

3. Copy the element setting from your application<br />

configuration file (App.config) to the User.config file. This file should contain only<br />

the element for which the runtime is redirected. Delete the directive and the<br />

element if present, as shown in the following example:<br />

<br />

<br />

http://localhost/someservice/Service.asmx<br />

<br />

<br />

4. In Solution Explorer, right-click the User.config file, click Properties, and then set<br />

the Copy To Output Directory property to Copy if newer.<br />

Individual developers should set their User.config file to reference the appropriate Web<br />

service URL reference.<br />

To update the App.config file to reference User.config file when accessing the Web<br />

service URL

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

Saved successfully!

Ooh no, something went wrong!