Man, why do i always have to learn the stuff the hard way?
I was doing a deployment of my RIA solution to the production server after a visual studio update (not sure if it’s connected or not), and i would start getting these strange errors when trying to log in:
There was a failure using the default ‘ProfileProvider’. Please make sure it is configured correctly. The database ‘C:INETPUBWWWROOTAPP_DATAASPNETDB.MDF’ cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported.
Cannot open user default database. Login failed.
Login failed for user ‘NT AUTHORITYNETWORK SERVICE’. InnerException message: The database ‘C:INETPUBWWWROOTAPP_DATAASPNETDB.MDF’ cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported.
Cannot open user default database. Login failed.
Login failed for user ‘NT AUTHORITYNETWORK SERVICE’.
The trouble is, i wasn’t using aspnedb.mdf at all. I figured i would just delete the database and everything would be fine. Then i got this:
Load operation failed for query ‘Login’. Access to the path ‘C:inetpubwwwrootApp_data’ is denied.
Seems that asp.net membership provider is trying to create that ASPNETDB.MDF file on the server although i’ve set it up (or so i thought) to use my database.
My web.config part (the one that’s important) looks like this:
<profile> <providers> <add name="CustomizedProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="database" applicationName="/AltiFin"/> </providers> <properties> <add name="FriendlyName"/> <add name="BranchGuid" type="System.Nullable`1[System.Guid]"/> </properties> </profile>
To cut the long story short, you should ALWAYS set defaultProvider on all the asp.net providers like this:
<profile defaultProvider="CustomizedProfileProvider"> <!--This part on the left! --> <providers> <clear/> <!--you should also put this on the left --> <add name="CustomizedProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="database" applicationName="/AltiFin"/> </providers> <properties> <add name="FriendlyName"/> <add name="BranchGuid" type="System.Nullable`1[System.Guid]"/> </properties> </profile>
Otherwise asp.net membership will try to create a default database. just to be safe, you should also put the
Leave a Comment