WindowsTokenRoleProvider.ApplicationName Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the name of the application.

Namespace:   System.Web.Security
Assembly:  System.Web (in System.Web.dll)

public override string ApplicationName { get; set; }

Property Value

Type: System.String

The name of the application.

Exception Condition

An attempt was made to set the ApplicationName property by a caller that does not have High ASP.NET hosting permission.


An attempt was made to set the ApplicationName to a string that is longer than 256 characters.

Unlike other role providers such as the SqlRoleProvider, the WindowsTokenRoleProvider class does not associate role information with an application. Instead, the role information is taken from the Windows groups on the local computer. Multiple applications on the same server that use the WindowsTokenRoleProvider class always share the same role information. Although the applicationName can be configured in the Web.config file for the application, the ApplicationName property is not used to retrieve role information.

The following example shows the element in the system.web section of the Web.config file for an ASP.NET application. It specifies the application's WindowsTokenRoleProvider instance and sets the ApplicationName property to MyApplication.

<roleManager defaultProvider="WindowsProvider" 
      applicationName="MyApplication" />

.NET Framework
Available since 2.0
Return to top