visual-studio-2015 - 添加迁移给出 "Unable to resolve project from ..."

标签 visual-studio-2015 entity-framework-core

在 ASP.NET 5 项目上使用 EF7 我尝试添加迁移,在 VS 包管理器控制台上键入以下内容:

dnx ef migrations add InitialDatabaseSetup

我得到了错误:
Unable to resolve project from C:\Projects\ASPNET5DEMO

项目在 C:\Projects\ASPNET5DEMO\src\aspnet5demo.web

如果使用 Developer Command Prompt 导航到该路径,然后运行该命令,则一切正常...

有没有办法使用包管理器控制台?

最佳答案

包管理器控制台只是一个 powershell 主机。如果您输入 pwd你会看到它的当前目录是 C:\Projects\ASPNET5DEMO .

然后你可以通过使用访问相关命令;

dnx -p src\aspnet5demo.web ef migrations add InitialDatabaseSetup

或者
cd src\aspnet5demo.web
dnx ef migrations add InitialDatabaseSetup

关于visual-studio-2015 - 添加迁移给出 "Unable to resolve project from ...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34123783/

相关文章:

c# - ASP Core 违反了 String 类型参数 'TRole' 的约束

c# - 在使用 app.UseRewriter().Add() 添加重定向时访问 Startup.Configure 中的 dbcontext

c# - 无法转换 EntityEntry 当前值

c# - 检测到不支持的 .Net Core 3.0 可能的对象循环

c# - 是否可以在 DbContext 中添加而不在 .net 核心中进行跟踪

c++ - LNK2019 未解析的外部符号_SDL_Init 在函数_SDL_main 中引用

angularjs - 如何从 Azure 下载 Web 应用程序?

c++ - '__builtin_address of' : identifier not found when running opencv in Visual Studio 2015

c# - 从 C# 交互窗口访问配置文件

c# - Visual Studio 2015 在 Try Catch block 中抛出异常