I have an ASP.NET MVC application with a number of membership-related pages generated from the project templates.
When I attempt to access one of those pages, I get the following error:
The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588.
After some time spent researching, I determined I was missing the connection string. I have an existing connection string named FreeWebFilesEntities
and I created a new connection string named DefaultConnection
, and gave it the same value.
<connectionStrings>
<add name="FreeWebFilesEntities" connectionString="metadata=res://*/FreeWebFilesRepository.csdl|res://*/FreeWebFilesRepository.ssdl|res://*/FreeWebFilesRepository.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.;Initial Catalog=FreeWebFiles;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
<add name="DefaultConnection" connectionString="metadata=res://*/FreeWebFilesRepository.csdl|res://*/FreeWebFilesRepository.ssdl|res://*/FreeWebFilesRepository.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.;Initial Catalog=FreeWebFiles;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
<connectionStrings>
But it still doesn't like this. I found some resources that suggested I'm using an EF connection string (and I am). I tried removing the metadata section of it but, no matter what I do, it throws an exception.
Since it appears Microsoft decided not to document this process very carefully (if at all), has anyone figured this out? How can I get the SimpleMembership pages to work?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…