简体   繁体   中英

Multiple Applications and one aspnetdb, problems with Profile

We are running several applications on the same aspnetdb. They are all using the same MembershipProvider. Sometimes we are getting "weird values" for Profile properties. It seems that the application is using data from a different application.

We already use different ApplicationName parameters.

Is there a way to clearly separate the applications without using distinct databases for the profiles?

This post is useful for what you need

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>

Add the same connectionstring for each application, and set different names in applicationName attribute

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM