'System.Web.Security.SqlMembershipProvider'需要与架构版本'1'兼容的数据库架构 [英] 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'

查看:126
本文介绍了'System.Web.Security.SqlMembershipProvider'需要与架构版本'1'兼容的数据库架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用配置文件,并且能够使用aspent_regsql -A p安装表.我可以在整个SQL Management Studio中看到它们.

I want to use profiles and was able to use aspent_regsql -A p to install the tables. I can see them throughout SQL management studio.

我实际上正在使用SQLExpress 2005,并且已填充dbo.aspnet_SchemaVersions.有人知道会出什么问题吗?

I'm actually using SQLExpress 2005, and my dbo.aspnet_SchemaVersions is populated. Does anybody know what could be going wrong?

顺便说一句,我很确定我的连接字符串和应用程序代码都正确. 预先感谢.

By the way, I'm pretty sure my connection string and app code are all right. Thanks in advance.

<system.web>
<membership>

  <providers>

    <remove name="AspNetSqlMembershipProvider" />

    <add name="AspNetSqlMembershipProvider"

      type="System.Web.Security.SqlMembershipProvider,

       System.Web, Version=2.0.0.0, Culture=neutral,                                

       PublicKeyToken=b03f5f7f11d50a3a"

      connectionStringName="RGConnectionString" />

  </providers>

</membership>
<profile>
  <providers>
    <add name="ProfileProvider" type="System.Web.Security.SqlProfileProvider,

       System.Web, Version=2.0.0.0, Culture=neutral,                                

       PublicKeyToken=b03f5f7f11d50a3a"

      connectionStringName="RGConnectionString"/>
  </providers>

推荐答案

好吧,我个傻瓜.我非常确定这是SQLExpress数据库的问题,但是实际上我的web.config文件完全很奇怪.我通过将正确的属性添加到提供程序来使其工作:

Well, fool of me. I was quite sure it was a problem with SQLExpress database but it was actually my web.config file that was totally weird. I got it to work by adding the correct properties to the providers:

  <connectionStrings>
    <add name="RGConnectionString"
         connectionString="Data Source=(local)\SQLExpress;Initial Catalog=aspnetdb;Integrated Security=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>

    <membership>
      <providers>
        <remove name="AspNetSqlMembershipProvider" />
        <add name="AspNetSqlMembershipProvider"
             type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             connectionStringName="RGConnectionString" 
             enablePasswordRetrieval="true"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="true"
             requiresUniqueEmail="true"
             passwordFormat="Clear"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="8"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             passwordStrengthRegularExpression="" 
             applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <add name="ProfileProvider"
             type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             connectionStringName="RGConnectionString"
             applicationName="/" />
      </providers>
    </profile>

  </system.web>

这篇关于'System.Web.Security.SqlMembershipProvider'需要与架构版本'1'兼容的数据库架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆