共用方式為


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)

Syntax

'宣告
ReadOnly Property UrlBehavior As eWebRefUrlBehavior
    Get
eWebRefUrlBehavior UrlBehavior { get; }
property eWebRefUrlBehavior UrlBehavior {
    eWebRefUrlBehavior get ();
}
abstract UrlBehavior : eWebRefUrlBehavior
function get UrlBehavior () : eWebRefUrlBehavior

Property Value

Type: Microsoft.VisualStudio.VCProjectEngine.eWebRefUrlBehavior
An eWebRefUrlBehavior enumeration value.

Remarks

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="https://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.

.NET Framework Security

See Also

Reference

VCFilter Interface

Microsoft.VisualStudio.VCProjectEngine Namespace