Saturday, August 25, 2007

ApplicationName" property & its importance while configuring ASP.NET 2.0 role & membership features

Why applicationName ?
applicationName is provided so as to enable us to map different applications to same database

this is a sample configuration for the 2.0 Roles



<add name="AspNetSqlRoleProvider"
connectionStringName="LocalSqlServer" applicationName="/"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />

<add name="AspNetWindowsTokenRoleProvider"
type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />


you develop the site using all the advanced features its works perfectly but when the site is exported / published on another server, these features wont work !!!!

The problem
when we are using the 2.0 features automatically uses the virtual root folder name of the application if does not find any value for the applicationName value in the .config files.

When we export the same configuration it no longer works because the 2.0 features are configured for some vroot which is not available in the new environment.


· Always provide some value to the applicationName (its not a must, but a good practice)

· Provide "/" as the value

No comments: