Redirects a Web service object to the ASP.NET Development Server instead of what is defined in the Web reference.
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
public static bool TryUrlRedirection( WebClientProtocol client, TestContext context, string identifier )
- Type: System.Web.Services.Protocols.WebClientProtocol
An instance of the Web service type being tested.
- Type: Microsoft.VisualStudio.TestTools.UnitTesting.TestContext
The TestContext for this unit test.
Return ValueType: System.Boolean
true if a redirect occurred; otherwise, false.
When you run a test with an AspNetDevelopmentServerAttribute, an instance of an ASP.NET Development Server is started. This ensures that an ASP.NET Development Server site is started and that you know the URL. When you run a test, you can then use TryUrlRedirection to redirect a Web service object so that it points to the known server instead of what is defined in the Web reference. This method returns true if the redirection was successful, and false if it was not, for example, if the identifier did not match the name of an existing ASP.NET Development Server instance.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.