.net core執行dotnet ef migrations createmodel等命令出錯


.net core執行dotnet ef migrations createmodel等命令出錯

  執行dotnet ef migrations createmodel、dotnet ef migrations add initial等命令出錯,報錯信息為:No project was found. Change the current working directory or use the --project option.命令出錯。個人百度.net core、dotnet ef migrations createmodel、dotnet ef migrations add initial、No project was found. Change the current working directory or use the --project option關鍵字都未發現這個問題的解決辦法,最后使用必應國內版,搜索No project was found. Change the current working directory or use the --project option.關鍵字,得到了解決辦法。

  第一種:dotnet ef migrations add InitialCreate --project="C:\path_to_my_project\MyProject.csproj"   使用這樣的命令操作,在我寫的代碼沒有作用,依然報出之前的問題;

  第二種:PM> cd "D:{path_to_your_projet}"  PM> dotnet ef migrations add initial 使用第二種方法解決了,不可以使用dotnet ef migrations createmodel、dotnet ef migrations add initial命令的問題。

   參考文章:Stack Overflow  GitHub

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM