我正在學習使用Visual Studio與教程構建ASP.NET Core MVC應用程序。在「Adding a model」的步驟我創建了一個新的單獨的項目(如寫入指令),但是當我運行dotnet ef database update
,出現以下錯誤:dotnet ef數據庫更新中的網絡相關或特定於實例的錯誤
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: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)
但我已經安裝了SQL Server和SQLEXPRESS服務正在運行。我也嘗試打開端口,但它沒有幫助。
連接字符串是什麼? – DavidG
你有這個工作嗎?我無法讓EF通過這個錯誤實際創建一個數據庫... – Joe