开发者

After upgrade, MVC3 tries to create membership tables

I've upgraded an asp.net mvc 2 project to mvc 3. I'm using a regular edition of SQL Server, not express.

After I upgraded to mvc 3 things seemed to work fine.

After I added the Deployable Dependencies, it tried to create tables on authentication using and machine.config configuration that was pointing to sql express (it failed).

I've removed the LocalSqlServer using my web.config file and got this:

Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

Source Error:

Line 236:       <membership>
Line 237:           <providers>
Line 238:               <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10"  passwordStrengthRegularExpression=""/>
Line 239:           </providers>
Line 240:       </membership>

I am using custom forms authentication with my own tables and this was working fine before upgrade. In hope of backward compatibility, none of my files model related files were upgraded from the previous version to this one (not really sure what to modify).

The only thing in my web.config file that is related to authentication is

<authentication mode="Fo开发者_高级运维rms">
  <forms loginUrl="~/login/" timeout="2880" />
</authentication>

Any ideas?

Thanks


Check the roles provider in the web.config and ensure that is pointed to the external database, if not it will generate the local database if you are using Roles.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜