2009-12-02 2 views
9

내 시스템에서 완벽하게 작동하는 웹 응용 프로그램이 있습니다. 그러나 다른 시스템에 복사 할 때 응용 프로그램에 로그인 할 수 없었습니다. 오류가 있습니다 :asp.net의 인스턴스 오류

Server Error in '/' Application. 
-------------------------------------------------------------------------------- 

Instance failure. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Instance failure. 

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. 

Stack Trace: 


[InvalidOperationException: Instance failure.] 
    System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4858423 
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90 
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +257 
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221 
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189 
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4859187 
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31 
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433 
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499 
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65 
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 
    System.Data.SqlClient.SqlConnection.Open() +122 
    System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +87 
    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +221 
    System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +815 
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 
    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78 
    System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60 
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119 
    System.Web.UI.WebControls.Login.AttemptLogin() +115 
    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101 
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118 
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166 
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 




-------------------------------------------------------------------------------- 
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 

이러한 오류의 원인 일 수있는 이유는 무엇입니까? 어떻게 해결할 수 있을까요?

답변

0

데이터베이스에 대한 연결을 열려고하면 오류가 발생합니다. 연결 문자열에 자격 증명을 지정합니까? 그렇지 않은 경우 두 서버간에 응용 프로그램 풀의 ID가 다를 수 있습니다.

2

당신이 당신의 새로운 서버에 따라 연결 문자열을 수정해야

+1

ASP.NET의 SQL 멤버 자격 공급자를 사용하고있는 것처럼 들리 겠지만 일반적으로 SQLExpress는 일반적으로 설치되고 로컬로 액세스됩니다. ASP.NET이 올바른 SQL Server 데이터베이스 인스턴스를 찾을 수 있도록 사이트를 다른 곳으로 복사 할 때 연결 문자열을 업데이트해야합니다. –

39

연결 문자열이 서버 이름과 데이터베이스 인스턴스 이름 사이에 이중 슬래시 포함되어 있습니까?

예 : 로컬 호스트 \\ SQLEXPRESS

그것은해야한다 : 로컬 호스트 \의 SQLEXPRESS

참조 :이 문제를 했어, 여러 SQL Server 인스턴스가 있었기 때문에 내 경우에는 그것이

http://www.hanselman.com/blog/CommentView.aspx?guid=89c01cae-e045-4b06-bff1-8dd2d596e266

+0

감사합니다. 오늘이 문제가 정확히 발생했습니다. –

+0

필자는 약간 다른 문제가 발생했다. 필자의 경우 백 슬래시는 servername : 'Server =. \ SQLEXPRESS \; Database = ...'끝에 있었다. 나는 그것을 다음과 같이 수정했다 :'Server =. \ SQLEXPRESS; Database = ...'! –

0

동일한 컴퓨터에 설치되었으며 모두 동일한 포트를 사용하도록 구성되었습니다.

3

나는이 문제가 있었고 나의 경우에는 "연결 문자열에 서버 이름과 데이터베이스 인스턴스 이름 사이에 이중 슬래시가 있습니다."

2

의 Web.config 에서 확인 연결 문자열은 이중 슬래시
server=(local)\\SQLEXPRESS이없는 확인 나는 슬래시를 제거하고 저도 같은 문제를했을 때 그것은했다. server=(local)\SQLEXPRESS

참고 : ". 인식 할 수없는 이스케이프 시퀀스"당신은 당신이 string로 연결 문자열을 정의하거나 을받을 수 있습니다 경우 .cs 파일에 이중 슬래시를해야합니까