ASP.Net 2.0 Membership providers and setting the application name

BronwenWeeGo.jpgWas playing around with ASP.Net membership providers and I’d created a few users and roles and everything looked happy.  Then i ran my application and I just couldn’t log in.  Upon investigation the app thought that there were 0 users available.  What had i done wrong?

I hadn’t set the applicationName property for the provider.  So when i used the configuration tool it was adding users to the “/MyProject” application, but when i ran the app it was just using the virtual directory and looking for users in the “/” project.

So make sure you set the applicationName property when you put your provider in the web.config.

 

<providers>
    <add name="CustomizedRoleProvider"
        type="System.Web.Security.SqlRoleProvider"
        connectionStringName="SoulSolutionsDB" 
        applicationName="/SoulSolutions.TestApp.Admin"/>
</providers>