2013-03-11 2 views
0

웹 사이트에 웹 사이트를 게시했지만 심각한 데이터베이스 문제가 있습니다. 이것은 내 오류ASP.NET MVC 4 데이터베이스 오류

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty. 

Line 255:   <providers> 
Line 256:    <add name="AspNetSqlMembershipProvider" 
Line 257:     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
Line 258:     connectionStringName="LocalSqlServer" 
Line 259:     enablePasswordRetrieval="false" 
Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config Line: 257 

이것은 연결 나의 호스트 문자열입니다 :

<connectionStrings> 
    <remove name="LocalSqlServer" /> 
    <add name="SiteSqlServer" connectionString="Server=(localhost);Database=ulprojec_******-***;uid=ulprojec_***;pwd=********a;" /> 

</connectionStrings> 

그리고 이것은 내가 마이크로 소프트의 웹 사이트에서 가져온 내 회원 연결 문자열이지만 여전히 첫 번째 오류가 발생합니다 :

<membership defaultProvider="SiteSqlServer" 
     userIsOnlineTimeWindow="15"> 
     <providers> 
     <add 
      name="SiteSqlServer" 
      type="System.Web.Security.SqlMembershipProvider" 
      connectionStringName="SiteSqlServer" 
      applicationName="georgi-it" 
      enablePasswordRetrieval="false" 
      enablePasswordReset="true" 
      requiresQuestionAndAnswer="true" 
      requiresUniqueEmail="false" 
      passwordFormat="Hashed" 
      maxInvalidPasswordAttempts="5" 
      passwordAttemptWindow="10" /> 
     </providers> 
    </membership> 

필자는 필사적으로 필자가 정말로 도움을 받았을 것이다.

편집 : 나는 정렬이 밖으로

지금이 문제를 가지고 : 당신은 "연결 문자열을 사용하는 것을 의미 오류가 당신이 받고있는 일이

Exception Details: System.ArgumentException: Invalid value for key 'attachdbfilename'. 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
+0

[이] (http://stackoverflow.com/questions/10984507/the-connection-name-localsqlserver-was-not-found-in-the-applications-configura) 본 적이 있습니까? –

+0

내가 본 것처럼 보였고 config 파일에 "attachdbfilename"이라는 문자열이 없다고 가정합니다. 연결 문자열의 일부처럼 들립니다. –

답변

1

잘 경우를 LocalSqlServer "다음 부분에 :

<providers> 
Line 256:    <add name="AspNetSqlMembershipProvider" 
Line 257:     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
**Line 258:     connectionStringName="LocalSqlServer"** 
Line 259:     enablePasswordRetrieval="false" 

그리고 여기서 연결 문자열을 제거합니다.

<connectionStrings> 
    **<remove name="LocalSqlServer" />** 
    <add name="SiteSqlServer" connectionString="Server=(localhost);Database=ulprojec_******-***;uid=ulprojec_***;pwd=********a;" /> 

</connectionStrings> 

나는 당신이 연결 문자열 간단한 명명 문제가 있음을 볼 수 있다고 생각합니다.

+0

그래, 알아 냈어.하지만 이제는 다른 문제가있어. –

0

회원 기능을 사용하지 않는 경우 루트 web.cofig 파일의 system.web 섹션에서 membership, profile 및 roleManager 태그를 제거하십시오. 이 문제를 해결하는 데 도움이되었습니다.

+0

정확히 어디에서 제거해야합니까? – Michael