.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

 

posted @   丁双磊  阅读(2271)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示