我是ASP.NET MVC編程中的新成員,我按照教程"Entity Framework 6" from Pluralsight。從Model自動創建具有「update-database ..」的表不起作用
我目前被困在「多遷移」部分。他說,命令
update-database -ConfigurationTypeName Books.Web.DataContexts.IdentityMigrations.Configuration
在package-manager-console中會自動在服務器資源管理器中創建表。但它不起作用。我得到這樣一個錯誤:
Network related or instance -specific error occurred while establishing a connection to SQL Server . The server was not found , or can not access it . Check if the instance name is correct and that SQL Server allows remote connections. Error: 50 - Error in the Local Database Runtime. The specified LocalDB instance does not exist.
我已閱讀與類似問題的其他問題,但我無法修復它。
你可以從你的web.config文件發佈你的連接字符串嗎? – kevindeleon
sure, connectionStrings> –
maxmusterman
難以...好吧,我相信他會經歷設置環境,以及如果他正在教授實體,那該怎麼辦? ..我會回去通過並仔細檢查你的DataContexts是否都設置得當,並且DefaultConnection是基於你可用的服務器,dbs等是正確的...... – kevindeleon