.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

.net core执行dotnet ef migrations createmodel等命令出错的更多相关文章

  1. EntityFramework Core 运行dotnet ef命令迁移背后本质是什么?(EF Core迁移原理)

    前言 终于踏出第一步探索EF Core原理和本质,过程虽然比较漫长且枯燥乏味还得反复论证,其中滋味自知,EF Core的强大想必不用我再过多废话,有时候我们是否思考过背后到底做了些什么,到底怎么实现的 ...

  2. Cookies 初识 Dotnetspider EF 6.x、EF Core实现dynamic动态查询和EF Core注入多个上下文实例池你知道有什么问题? EntityFramework Core 运行dotnet ef命令迁移背后本质是什么?(EF Core迁移原理)

    Cookies   1.创建HttpCookies Cookie=new HttpCookies("CookieName");2.添加内容Cookie.Values.Add(&qu ...

  3. .net core 2.0 dbfirst 报 dotnet ef 未找到与命令“dotnet-ef”匹配的可执行文件的解决办法

    问题描述: 最近研究了一段时间.netcore dbfirst,新建类库用来生成实体模型,执行命令总是提示 未找到与命令“dotnet-ef”匹配的可执行文件,根据网上的解决办法引用 Microsof ...

  4. dotnet ef执行报错, VS 2019发布时配置项中的Entity Framework迁移项显示不出来

    VS 2019发布时配置项中的Entity Framework迁移项显示不出来 dotnet ef dbcontext list --json “无法执行,因为找不到指定的命令或文件.可能的原因包括: ...

  5. asp.net core系列 30 EF管理数据库架构--必备知识 迁移

    一.管理数据库架构概述 EF Core 提供两种主要方法来保持 EF Core 模型和数据库架构同步.一是以 EF Core 模型为基准,二是以数据库为基准. (1)如果希望以 EF Core 模型为 ...

  6. Asp.net core 学习笔记 ( ef core )

    更新 : 2018-11-26 这里记入一下关于 foreignKey cascade action 默认情况下如果我们使用 data annotation required + foreginkey ...

  7. ASP.NET Core中使用EF Core(MySql)Code First

    ⒈添加依赖 MySql.Data.EntityFrameworkCore ⒉在appsettings.json配置文件中配置数据库连接字符串 { "Logging": { &quo ...

  8. EF Core 迁移过程遇到EF Core tools version版本不相符的解决方案

    如果你使用命令: PM> add-migration Inital 提示如下信息时: The EF Core tools version '2.1.1-rtm-30846' is older t ...

  9. dotnet ef

    dotnet ef migrations add <Name-of-Migration> dotnet ef database update

随机推荐

  1. mysql数据导入的时候提示Got a packet bigger than 'max_allowed_packet' bytes

    Got a packet bigger than 'max_allowed_packet' bytes错误 默认可能是2M 把max_allowed_packet设置大于5M试试,我设置为160M,输 ...

  2. 浅析JavaScript中的typeof运算符

    对JavaScript中的typeof运算符进行了详细的分析介绍,需要的朋友可以过来参考下,希望对大家有所帮助. 如果typeof的运算符是数字.字符串或者布尔值,它返回的结果就是"numb ...

  3. 用Msxml2.XMLHTTP 与 Msxml2.ServerXMLHTTP 发生网页请求

    发送 HTTP 请求时,首先想到的一般是 Msxml2.XMLHTTP(Microsoft.XMLHTTP 已经不提倡使用了). ServerXMLHTTP 为不同 Web 服务器之间的服务器安全 H ...

  4. TNS:no listener error in Oracle XE after changing computer name

    This morning at work when trying to log on to my computer I noticed not my username on login screen ...

  5. 数据库帮助类 SqlServerHelp

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...

  6. java 线程之对象的同步和异步

    一.多线程环境下的同步与异步 同步:A线程要请求某个资源,但是此资源正在被B线程使用中,因为同步机制存在,A线程请求不到,怎么办,A线程只能等待下去. package com.jalja.org.th ...

  7. 解题报告-Perfect Squares

    Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 1 ...

  8. golang之递归

    翠花,上代码 package main import ( "fmt" "time" ) /* 递归原则,一个大问题分解成相似的小问题 定义好出口条件,否则死循环 ...

  9. Laravel 5 项目部署到生产环境的实践

    作者:mrcn链接:https://www.zhihu.com/question/35537084/answer/181734431来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请 ...

  10. 关于自动ui的多个处理我的解决方案, 不知道大家怎么处理

    ( pathpp ="D:\\pyc-tools\\ms\\newdate\\maxinfo" DialogMonitorOPS.unRegisterNotification id ...