ASP.NET Core 1.0 Webアプリケーション(Entity Framework Core)からSQL Server 2014または2016に接続しようとしています。私は以下のエラーが発生しています。どのようにそれを解決するためのヒント。ASP.NET Core 1 EF7でSQL Serverに接続できません
Visual Studio 2015 SQL ServerオブジェクトエクスプローラからDBに正常に接続できます。ただし、Webアプリケーションからの接続は失敗します。どちらも私はdotnet ef database update
できません。
私はLOCALDBに接続できます。
が"DefaultConnection": "Data Source=server;Initial Catalog=TestDb;Integrated Security=False;User ID=sa;Password=*****;Connect Timeout=15;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
私が手にエラーがある:
私の接続文字列は次のようになります。私は、SQL Server 2014および2016で同じエラーを取得:
An unhandled exception occurred while processing the request.
Win32Exception: The network path was not found
.ctor
SqlException: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
スタックトレースは次のとおりです。
Win32Exception: The network path was not found
.ctor
CreateConnection
CreatePooledConnection
CreateObject
UserCreateRequest
TryGetConnection
WaitForPendingOpen
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
GetResult
MoveNext in AccountController.cs
var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false);
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
MoveNext
ThrowForNonSuccess
HandleNonSuccessAndDebuggerNotification
MoveNext
EDIT 1
これは同じ問題ではありません、注意してください。なぜ私は得るのですか"Cannot Connect to Server - A network-related or instance-specific error"?
EDIT 2
問題が発生しているこのプロジェクトのタイプは、ASP.NETコアWebアプリケーション(.NET コア)です。
私はASP.NETコアWebアプリケーションを作成することで、試してみましたが(.NET Frameworkの)プロジェクトとそこには問題はありませんでした。私は接続することができました。
これらのプロジェクトの違いは何ですか?
の可能性のある重複した[なぜ私が「サーバーに接続できない - ネットワーク関連またはインスタンス固有のエラー」を取得しています?](http://stackoverflow.com/questions/18060667/why-am-iネットワークに関連する、またはインスタンス固有のサーバーに接続できません) – Igor
これは重複していないため、同じ問題ではありません。 VS2015 SQL Server Object ExplorerやSerer Management Studioなど、他のクライアントからサーバーに接続できます。しかし、私のASP.NET Core MVC Webアプリケーションは失敗します。 – feradz
接続文字列を最小限に抑えようとしましたか? 'Data Source'、' Initial Catalog'、 'User ID'、' Password'パラメータを使って試してみましょう。 – Brad