欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

.net core执行dotnet ef migrations createmodel等命令出错

程序员文章站 2022-12-16 10:14:57
.net core执行dotnet ef migrations createmodel等命令出错 执行dotnet ef migrations createmodel、dotnet ef migrations add initial等命令出错,报错信息为:No project was found. ......

.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命令的问题。

.net core执行dotnet ef migrations createmodel等命令出错

.net core执行dotnet ef migrations createmodel等命令出错

   参考文章:stack overflow  github