2013-03-26 79 views
0

我们在同一个aspnetdb上运行多个应用程序。 他们都使用相同的MembershipProvider。有时我们会为配置文件属性获取“奇怪的值”。看起来应用程序正在使用来自不同应用程序的数据。多个应用程序和一个aspnetdb,配置文件的问题

我们已经使用了不同的ApplicationName参数。

有没有办法清楚地分开应用程序,而不使用不同的数据库的配置文件?

回答

1

这篇文章是你所需要的

http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx

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

添加相同的ConnectionString为每个应用程序非常有用,并且在applicationName属性设置不同的名称

相关问题