Microsoft Developer Network > 포럼 홈 > Visual C# General > console app won't work outside visual studio IDE
질문하기질문하기
 

답변됨console app won't work outside visual studio IDE

  • 2009년 11월 8일 일요일 오전 3:20Duppy Geezus 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음
    Hello,

    I have a console app that uses a DB.xsd file to make calls to/from a database.

    When I run the console app in debug/release within the visual studio IDE, it works without any problems.

    But if I release/compile or run the debug copy outside of visual studiot it throws a DB error every time!

    Here is the error:

    Unhandled Exception: System.Data.SqlClient.SqlException: A network-related or in
    stance-specific error occurred while establishing a connection to SQL Server. Th
    e server was not found or was not accessible. Verify that the instance name is c
    orrect and that SQL Server is configured to allow remote connections. (provider:
     SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception
    , Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
    ect stateObj)
       at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternal
    ConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Bool
    ean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection
    owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
    serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire,
     SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host
    , String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject
    , SqlConnectionString connectionOptions, Int64 timerStart)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnecti
    on owningObject, SqlConnectionString connectionOptions, String newPassword, Bool
    ean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdent
    ity identity, SqlConnectionString connectionOptions, Object providerInfo, String
     newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOp
    tions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
     owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConn
    ection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owning
    Object)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection o
    wningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection ownin
    gObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection ow
    ningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection ou
    terConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at 
    Does anyone know what I'm doing wrong with my compiling?

    Thanks!!!

답변

모든 응답