我在专用端口(路径:https://server:8085/service)上的单独网站中部署了一个应用程序。有用。 现在我想在新的IIS应用程序(路径https://server/newapp/service)下部署它。问题是我收到应用程序无法连接到SQL Server的错误。应用程序池是相同的,站点和应用程序都指向磁盘上的同一文件夹。
[Win32Exception(0x80004005):无法找到指定的文件]
[SqlException(0x80131904):建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供程序:SQL网络接口,错误:26 - 找到指定的服务器/实例时出错)]
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,UInt32 waitForMultipleObjectsTimeout,Boolean allowCreate,Boolean onlyOneCheckConnection,DbConnectionOptions userOptions,DbConnectionInternal& connection)+642
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource
1 retry,DbConnectionOptions userOptions,DbConnectionInternal oldConnection,DbConnectionInternal& connection)+1079
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection,DbConnectionFactory connectionFactory,TaskCompletionSource 1 retry, DbConnectionOptions userOptions) +6605639
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource
1 retry)+233
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)+278
System.Data.SqlClient.SqlConnection.Open()+239
System.Web.SessionState.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo,TimeSpan retryInterval)+309
[HttpException(0x80004005):无法连接到SQL Server会话数据库。] System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection conn,Exception e)+3539419 System.Web.SessionState.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo,TimeSpan retryInterval)+3533255 System.Web.SessionState.SqlSessionStateStore.GetConnection(String id,Boolean& usePooling)+500 System.Web.SessionState.SqlSessionStateStore.ResetItemTimeout(HttpContext context,String id)+78 System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source,EventArgs e,AsyncCallback cb,Object extraData)+707 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+12335126 System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean& completedSynchronously)+288
答案 0 :(得分:1)
请检查配置文件,还应检查应用程序和sqlserver的访问权限。
答案 1 :(得分:0)
右键单击桌面并创建新文档'然后将.txt扩展名更改为.udl,然后您可以输入SQL Server凭据和“测试连接”。
我的赌注是你无法访问SQL服务器
'验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。'