私のASP.NET MVCアプリケーションでは、新しいADO.netエンティティオブジェクト&が(localDB)\mssqllocaldb
(接続文字列が自動的に作成されたテーブル名tblProduct
)。このエンティティに新しいコントローラ(たとえばProduct
)を追加してインデックスページにアクセスしようとすると、エラーが発生します。(localDB) mssqllocalDBの自動生成された接続文字列がMVCで機能していません
注:私は、Visual StudioのサーバーエクスプローラでDataConnectionsでデータベースを参照することも、SQL Server Management Studioでデータベースに接続することができると思います
エラー:
Exception message: 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: 50 - Local Database Runtime error occurred. Cannot get a local application data path. Most probably a user profile is not loaded. If LocalDB is executed under IIS, make sure that profile loading is enabled for the current user.)
アプリケーションログにWindowsのログオン:
Cannot get a local application data path. Most probably a user profile is not >loaded. If LocalDB is executed under IIS, make sure that profile loading is >enabled for the current user.
接続文字列
add name="productsContextV12" connectionString="metadata=res:///Models.products.csdl|res:///Models.products.ssdl|res://*/Models.products.msl;provider=System.Data.SqlClient;provider connection string="data source=(LocalDB)\mssqllocaldb;initial catalog=EMPDB2;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
あなたは私たちに動作していないたconnectionStringを表示することができますか? – GuidoG
質問を編集して接続文字列を読み取り可能にすることはできますか? – GuidoG