VCFilter.UrlBehavior Property

 

Gets a value indicating whether the URL of a Web reference is hard-coded in the generated Visual Basic or Visual C# proxy code. This property is meaningful only for filters that have Web references.

Namespace:   Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

eWebRefUrlBehavior UrlBehavior { get; }

The proxy code is the .vb or .cs file which is generated from the .wsdl file and is used to make the SOAP call to the Web service at run time. If the value of UrlBehavior is webrefUrlBehaviorDynamic, the URL value is stored with the project's dynamic properties. The project system adds a key to the App.config file (for Windows applications) or Web.config file (for Web applications).

An example of the key/value pair from an App.config file is shown below:

<configuration>

<appSettings><add key="SomeProject.localhost.Service1"

value="http://localhost/SomeWebService/Service1.asmx"/>

</appSettings>

</configuration>

By using a dynamic URL, you can specify different Web service locations for different project configurations. A common scenario is to use a local service for a debug configuration and a nonlocal service for a release configuration.

Return to top
Show: