I have a SQL Server 2008 DB with many tables filled with data and I used SQL Server Management Studio to generate a SQL dump by using the Script Wizard : Tasks -> Generate S
I tried many of the options above, but none of them seemed to resolve the issue at the time (although they may have helped and I didn't realize it).
The last step I took [that worked] was granting the SQL user in my connection string access to the aspnet_* roles installed by aspnet_regsql.exe. My SQL user was setup as a db_owner on the database, but wasn't a sysadmin on the box - not sure if that matters.
As soon as I did that, and after I'd already tried some of the options above, everything worked great.
This basically comes when you copy/past complete website solution. ASP.NET configuration for SQL server should be configured separately. Which means you should run the aspnet_regsql from Visual Studio command prompt and follow instruction accordingly during wizard.
I first received this error after forgetting to run the aspreg_sql on my new db. Once done I received this error until I shut down Cassini or the ASP.NET development server. Re-ran and it worked fine.
In my case neither of above solutions worked.
I removed applicationName="/" from memnership provider in webconfig which was created by visual studio and then uploaded it to server.
Or you can crate the application row in aspnet_Applications table manually.
Have a nice coding!
Try updating the web config file with correct version of System.Web.Security.SqlRoleProvider
You can find the below configuration in c:/windows/microsoft.net/framework/v4.0.30319 or any other version , there you can find config file . Into it check for machine config files to get version & public key.
For .net frameowork 4.0
<roleManager enabled="true" defaultProvider="SqlProvider">
<providers>
<clear/>
<add name="SqlProvider" connectionStringName="rolesDB" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>
for .net framework 2.0
<roleManager enabled="true" defaultProvider="SqlProvider">
<providers>
<clear/>
<add name="SqlProvider" connectionStringName="rolesDB" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>
If you really haven't forgotten anything (views, SP's, etc. etc. etc.), then googling indicates that 'silly' solutions like closing the project and re-opening, rebuilding, or:
The thing that actually did the trick was going through the ASP.NET Configuration utility (Visual Studio - under Website menu), taking the application offline and then back online. This actually just makes a change to web.config (not exactly sure what the change was). So after taking it offline, I had to upload web.config to the hosted solution. Then took the application back online, recopied web.config, etc.
May be the answer.