{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/4586","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/4586/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/4586/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/4586/events","html_url":"https://github.com/dotnet/corefx/issues/4586","id":117891514,"number":4586,"title":"SQL Server connection fails via web app, but succeeds in all other tools","user":{"login":"SimonOrdo","id":15930167,"avatar_url":"https://avatars.githubusercontent.com/u/15930167?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonOrdo","html_url":"https://github.com/SimonOrdo","followers_url":"https://api.github.com/users/SimonOrdo/followers","following_url":"https://api.github.com/users/SimonOrdo/following{/other_user}","gists_url":"https://api.github.com/users/SimonOrdo/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonOrdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonOrdo/subscriptions","organizations_url":"https://api.github.com/users/SimonOrdo/orgs","repos_url":"https://api.github.com/users/SimonOrdo/repos","events_url":"https://api.github.com/users/SimonOrdo/events{/privacy}","received_events_url":"https://api.github.com/users/SimonOrdo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/corefx/labels/System.Data","name":"System.Data","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"saurabh500","id":1623701,"avatar_url":"https://avatars.githubusercontent.com/u/1623701?v=3","gravatar_id":"","url":"https://api.github.com/users/saurabh500","html_url":"https://github.com/saurabh500","followers_url":"https://api.github.com/users/saurabh500/followers","following_url":"https://api.github.com/users/saurabh500/following{/other_user}","gists_url":"https://api.github.com/users/saurabh500/gists{/gist_id}","starred_url":"https://api.github.com/users/saurabh500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saurabh500/subscriptions","organizations_url":"https://api.github.com/users/saurabh500/orgs","repos_url":"https://api.github.com/users/saurabh500/repos","events_url":"https://api.github.com/users/saurabh500/events{/privacy}","received_events_url":"https://api.github.com/users/saurabh500/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/6","html_url":"https://github.com/dotnet/corefx/milestones/1.0.0-rc2","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/6/labels","id":1365455,"number":6,"title":"1.0.0-rc2","description":"","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":152,"closed_issues":95,"state":"open","created_at":"2015-10-20T04:29:15Z","updated_at":"2015-11-19T21:24:30Z","due_on":"2016-02-02T08:00:00Z","closed_at":null},"comments":1,"created_at":"2015-11-19T19:38:24Z","updated_at":"2015-11-19T21:25:33Z","closed_at":null,"body":"I'm running ASP.NET 5, RC1 and am trying to connect to a MSSQL server instance on the local network.  There are no firewalls between here and there.  *If I try the same code in the same environment under MVC 5, everything works fine.*\r\n\r\nI am able to connect to the server successfully with the VS2015 Server Explorer as well as SQL Management Studio.\r\n\r\nWhen I attempt to connect to the DB with the following connection string (which I got from the VS2015 Server Explorer), it fails with the given error:\r\n\r\nstring cs = @\"Data Source=DBSERVER\\INSTANCE1;Initial Catalog=MyDb;User ID=ASPNET-Db-User;Password=thepassword\";\r\n\r\nThe code is:\r\n System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(cs);\r\n con.Open();\r\n\r\nThe exception is:\r\n\r\nAn exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.SqlClient.dll but was not handled in user code\r\n\r\nAdditional information: 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)\r\n\r\nThe stack is:\r\n   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)\r\n   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)\r\n   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, TimeoutTimer timeout)\r\n   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, Boolean redirectedUserInstance)\r\n   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)\r\n   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)\r\n   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)\r\n   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)\r\n   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)\r\n   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)\r\n   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)\r\n   at System.Data.SqlClient.SqlConnection.Open()\r\n   at Isengard.Startup.ConfigureServices(IServiceCollection services) in C:\\TFS\\Isengard\\src\\Isengard\\Startup.cs:line 46\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/158202529","html_url":"https://github.com/dotnet/corefx/issues/4586#issuecomment-158202529","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/4586","id":158202529,"user":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T21:25:33Z","updated_at":"2015-11-19T21:25:33Z","body":"@corivera @saurabh500 @kkurni PTAL"}}