2010-11-26 2 views
0

ASP.NET 4.0 멤버쉽에 문제가 있습니다. 내 web.config 파일에서 모든 구성원 구성을 갖고 machine.config를 사용하지 않길 원합니다. MYSERVER \ A라는 원격 SQL Server 2008 R2 데이터베이스 서버에 멤버쉽을 저장합니다.회원 공급자에게 문제가 발생했습니다.

An error was encountered. Please return to the previous page and try again. 

The following message may help in diagnosing the problem: The connection name 'MarksDB' was not found in the applications configuration or the connection string is empty. at System.Web.Util.SecUtility.GetConnectionString(NameValueCollection config) at System.Web.Security.SqlMembershipProvider.Initialize(String name, NameValueCollection config) at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) 
: 나는 ASP.NET 구성> 웹 사이트 -을로 이동하여 보안 탭에서 사용자 추가를 클릭하면 여기에, 비주얼 스튜디오 2010의 Web.config

<connectionStrings> 
    <clear/> 
    <add name="MarksDB" connectionString="Server=MYSQLSERVER\A;Database=test_d; Trusted_Connection=Yes; Application Name=MarksDB"/> 
</connectionStrings> 
<system.web> 

<authorization> 
    <allow roles="Admins" /> 
    <deny users="?" /> 
</authorization> 
<authentication mode="Forms"> 
    <forms name="MarksDB" /> 
</authentication> 
<membership defaultProvider="MarksDBMembershipProvider"> 
    <providers> 
    <clear/> 
    <add 
     name="MarksDBMembershipProvider" 
     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     connectionStringName="MarksDB" 
     enablePasswordRetrieval="false" 
     enablePasswordReset="true" 
     requiresQuestionAndAnswer="true" 
     applicationName="MarksDBMembershipProvider" 
     requiresUniqueEmail="false" 
     passwordFormat="Hashed" 
     maxInvalidPasswordAttempts="5" 
     minRequiredPasswordLength="7" 
     minRequiredNonalphanumericCharacters="1" 
     passwordAttemptWindow="10" 
     passwordStrengthRegularExpression=""/> 

    </providers> 
</membership> 

<roleManager enabled="true" defaultProvider="MarksDBRoleProvider"> 
    <providers> 
    <clear/> 
    <add 
     name="MarksDBRoleProvider" 
     type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     connectionStringName="MarksDB" 
     applicationName="MarksDBRoleProvider" 
     />   
    </providers>  
</roleManager> 

의 관련 섹션, 난이 오류가

이 문제를 해결하는 방법을 모르겠습니다. 어떤 아이디어?

답변

0

멤버 자격 공급자 및 역할 관리자에서 동일한 데이터베이스를 사용하는 다른 응용 프로그램을 사용할 수 있으므로 applicationName 특성을 사용하여 응용 프로그램을 지정해야합니다. 그러나 연결 문자열에 Application Name을 지정하고 있습니다.

applicationName을 멤버 자격 공급자 및 역할 공급자에서 제거 할 수 있다고 생각합니다.

+0

내 web.config의 멤버 자격 공급자 및 역할 공급자에서 applicationName 속성을 제거했지만 사용자 만들기를 클릭해도 여전히 동일한 오류가 발생합니다. –

+0

내 machine.config가 복원되었으며 현재 모두 작동합니다. 기괴하다. 왜냐하면 내가 거기에서 아무 것도 읽지 않기 때문이다. –

관련 문제