我建立一個項目在VS 2015年,我試圖啓用的遷移創建一個使用實體框架的數據庫,但我得到一個錯誤:的Visual Studio - 啓用 - 遷移問題
Cannot determine a valid start-up project. Using project 'Data Manager' instead. Your configuration file and working directory may not be set as expected. Use the -StartUpProjectName parameter to set one explicitly. Use the -Verbose switch for more information. No context type was found in the assembly 'Data Manager'.
我發現幾條線索和潛在的解決方案,但沒有運氣。到目前爲止,我曾嘗試:
重建方案和重置VS
我證實,默認的項目設置爲「DataManager的」與 既是「nuget.org」和「全部」包源
啓用的遷移-ProjectName的DataManager
我重新安裝與條命令:安裝,包裝的EntityFramework -IncludePrerelea se
我在想什麼?
可以顯示上下文類代碼? – Sampath
您是否嘗試過從nuget控制檯中的「默認項目」組合框中選擇包含您的dbcontext的項目? – Den
所以它看起來像我缺少上下文......我不知道上下文類代碼將在哪裏,如果我錯過了它,應該在它裏面......假設它應該是圍繞「dbcontext」的東西。我已經看到了教程中的「Identity Models」模型,下面有一個applicaitondbcontext類,但我認爲它是自動生成的......我將轉到他們的github,看看我是否可以手工複製它,然後嘗試遷移 – user2653814