NuGet 包管理器控制台默认项目下拉列表为空

您所在的位置:网站首页 频道列表为空怎么办 NuGet 包管理器控制台默认项目下拉列表为空

NuGet 包管理器控制台默认项目下拉列表为空

2024-05-09 18:19| 来源: 网络整理| 查看: 265

我最近从 MSDN 升级到 Visual Studio 2012 RTM Ultimate。我正在使用 EF Code First Migrations 在我的应用程序中构建数据库,最近添加了一个新实体并希望为其迁移搭建支架。

为此,您需要在 VS 中打开“包管理控制台”窗口,然后键入 add-migration "some name here"。这将构建自上次更新以来数据库的所有更改。

问题

VS 2012 RC 上没有出现此问题

我遇到的问题是包管理器控制台中的“默认项目”下拉列表未填充,尽管我的解决方案中有多个项目。当我仅键入上面的命令时使用的默认项目是错误的项目(我的迁移位于另一个项目中)。当我执行此操作时,出现以下错误:

No migrations configuration type was found in the assembly 'ProjectA'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).

我尝试过的

我尝试将正确的项目(ProjectB)设置为启动项目,却收到此错误:

Could not load assembly 'ProjectA'. (If you are using Code First Migrations inside Visual Studio this can happen if the startUp project for your solution does not reference the project that contains your migrations. You can either change the startUp project for your solution or use the -StartUpProjectName parameter.)

问题

如何手动指定添加到哪些项目迁移,或强制填充“默认项目”下拉列表?

最佳答案

在 VS 2015 中,我刚刚重新启动 IDE,下拉列表又被填充了。

关于NuGet 包管理器控制台默认项目下拉列表为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12028457/



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3