TestContext.AspNetDevelopmentServerPrefix Field

 

Represents the prefix for ASP.NET Development Server.

Namespace:   Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Syntax

public const string AspNetDevelopmentServerPrefix
public:
literal String^ AspNetDevelopmentServerPrefix
static val mutable AspNetDevelopmentServerPrefix : string
Public Const AspNetDevelopmentServerPrefix As String

Field Value

Type: System.String

Remarks

The value of this constant is "AspNetDevelopmentServer."

In most cases, you will not use this string directly because you can use the TryUrlRedirection method to direct Web service calls to the correct URL.

If you want to get the URL prefix for the ASP.NET Development Server instance that is launched as a result of specifying the AspNetDevelopmentServerAttribute on your test, then you must use this string. Use this string together with the name that you specified in the AspNetDevelopmentServerAttribute. See the following code snippet for more information.

Examples

Legacy Code Example

[TestMethod]
[AspNetDevelopmentServerAttribute("MyServer", @"c:\websites\website1", "/website1")]
public void Test()
{
    Uri uriPrefix = TestContext.Properties[TestContext.AspNetDevelopmentServerPrefix + "MyServer"];
}

See Also

TestContext Class
Microsoft.VisualStudio.TestTools.UnitTesting Namespace

b41b6c8b-5c47-4445-a73a-1b095c626c93

Return to top