升级后,MVC3 尝试创建成员资格表
我已将 asp.net mvc 2 项目升级到 mvc 3。我使用的是 SQL Server 的常规版本,而不是 Express。
在我升级到 mvc 3 后,一切似乎工作正常。
添加可部署依赖项后,它尝试使用指向 sql express 的 machine.config 配置来创建身份验证表(失败)。
我已经使用 web.config 文件删除了 LocalSqlServer 并得到了以下信息:
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>
我正在对自己的表使用自定义表单身份验证,并且在升级之前工作正常。为了向后兼容,我的文件模型相关文件都没有从以前的版本升级到这个版本(不太确定要修改什么)。
我的 web.config 文件中与身份验证相关的唯一内容是
<authentication mode="Forms">
<forms loginUrl="~/login/" timeout="2880" />
</authentication>
Any ideas?
谢谢
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="Forms">
<forms loginUrl="~/login/" timeout="2880" />
</authentication>
Any ideas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查 web.config 中的角色提供程序并确保其指向外部数据库,如果没有,如果您使用角色,它将生成本地数据库。
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.