0

I have an application deployed in separate website on dedicated port (path: https://server:8085/service). It works. Now I want to deploy it under new IIS application (path https://server/newapp/service). The problem is that I'm getting error that the app is unable to connect to sql server. The app pool is the same and both the site and the application point to the same folder on disk.

[Win32Exception (0x80004005): Unable to find the specified file]

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)] 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, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +1079 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) +6605639 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 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): Unable to connect to SQL Server session database.] 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

4
  • please you can share connectionstring code format and let me know where you place this piece of code whether in web.cofig or some where else Commented Jun 6, 2016 at 6:27
  • Nazir, it's standard connection string in web.config. What is weird that the application works fine from dedicated site/port and there is no problem with connnecting to the database from there. Commented Jun 6, 2016 at 10:40
  • is it using a relative path for anything? Commented Jun 6, 2016 at 13:42
  • no, it does not use any relative paths Commented Jun 6, 2016 at 14:22

2 Answers 2

1

Please check the configuration file and you should also check for access privileges for the application and sqlserver.

Sign up to request clarification or add additional context in comments.

2 Comments

The configuration file is fine - it works for dedicated site. What kind of access privileges do you mean?
the application which you are hosted in IIS does't have full control..check for security.
0

Right click on the desktop and 'create new document' then change the .txt extension to .udl, then you can enter the SQL server credentials and 'Test Connection'

my bet is the SQL server is not accessible have you

'Verify that the instance name is correct and that SQL Server is configured to allow remote connections.'

1 Comment

it is accessible from the same application in dedicated site on IIS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.