2011-08-29 4 views
0

엔터티 데이터 모델을 사용하여 데이터베이스에 연결하고 있습니다. 그것은 로컬로 잘 작동합니다. 내가 서버에 내 웹 사이트를 업로드 할 때 다음과 같은 오류가 발생합니다 :엔터티 데이터 모델 System.ArgumentOutOfRangeException

Server Error in '/' Application. 
Non-negative number required. 
Parameter name: count 
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.ArgumentOutOfRangeException: Non-negative number required. 
Parameter name: count 

Source Error: 

Line 14:    //Fill the Route collection here. 
Line 15:    routes.Clear(); 
Line 16:    foreach (var page in context.PageInfos) 
Line 17:    { 
Line 18:     //get the friendly URL 


Source File: e:\HostingSpaces\homelink\dev.homelinkfamilysupport.org\wwwroot\Global.asax Line: 16 

Stack Trace: 

[ArgumentOutOfRangeException: Non-negative number required. 
Parameter name: count] 
    System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count) +0 
    System.Data.SqlClient.TdsParserStateObject.ReadByteArray(Byte[] buff, Int32 offset, Int32 len) +153 
    System.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(Boolean encrypt, Boolean trustServerCert, Boolean& marsCapable) +173 
    System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +473 
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129 
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +164 
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195 
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232 
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185 
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33 
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524 
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479 
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108 
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126 
    System.Data.SqlClient.SqlConnection.Open() +125 
    System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +52 

[EntityException: The underlying provider failed on Open.] 
    System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +161 
    System.Data.EntityClient.EntityConnection.Open() +98 
    System.Data.Objects.ObjectContext.EnsureConnection() +81 
    System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +46 
    System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +44 
    ASP.global_asax.RegisterRoutes(RouteCollection routes) in e:\HostingSpaces\homelink\dev.homelinkfamilysupport.org\wwwroot\Global.asax:16 
    ASP.global_asax.Application_Start(Object sender, EventArgs e) in e:\HostingSpaces\homelink\dev.homelinkfamilysupport.org\wwwroot\Global.asax:7 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

가 원래의 .BAK 파일 (에서 복원되었을 때 서버의 데이터베이스는 확실히 동일한 구조와 데이터를 가지고있는로부터 EDM이 생성됨).

이 문제에 대한 도움을 주시면 감사하겠습니다.

답변

1

참고 사항 : 이것은 호스팅 공급자가 SQL 서버에 연결하기 위해 사용해야했던 포트를 변경했기 때문에 발생했습니다. 코드와 관련이 없습니다.

관련 문제