码迷,mamicode.com
首页 > 其他好文 > 详细

unable to initialize provider

时间:2015-04-03 09:07:29      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:

场景:新服务器发布

系统:windows server 2012

程序环境:mysql6.9.5,iis8.5,.net4.0

错误:unable to initialize provider

分析原因:项目中采用了membership,安装新数据库时直接copy了原数据库的membership表

解决方法:步骤1.假如数据库中没有membership的表,修改machine.config (c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\machine.config)中添加  autogenerateschema="true",具体位置放置如下

  <membership>
      <providers>
        <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="" />
        <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" autogenerateschema="true"/>
      </providers>
    </membership>

2.删除数据库中的membership表,重启启动项目将自动生成相对应数据库表,生成成功

 

unable to initialize provider

标签:

原文地址:http://www.cnblogs.com/wangjiachen/p/4389035.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!