我正在尝试在 Visual Studio 2015 RTM 中使用 ASP.NET 5 beta5 和 Entity Framework 7 beta6。问题是即使完全遵循这样的指南,我也无法让它们一起运行: http://ef.readthedocs.org/en/latest/getting-started/aspnet5.html
在此示例中,当我到达需要运行此命令的部分时:
dnx . ef migration add MyFirstMigration
我总是得到这个错误:
Using context 'BloggingContext'.
System.MissingMethodException: Method not found: 'Boolean Microsoft.Framework.DependencyInjection.ServiceCollectionExtensions.TryAdd(Microsoft.Framework.DependencyInjection.IServiceCollection, Microsoft.Framework.DependencyInjection.ServiceDescriptor)'.
我尝试并重试了所有步骤并搜索了我在我的项目中可能遗漏的所有内容,但没有成功。
最佳答案
这个问题可能是因为您使用的 Dot Net 虚拟机版本不正确(或有问题)。尝试运行 dnvm list
以查看您安装了哪些版本以及哪个版本设置为事件,然后您可能需要运行 dnvm use ...
来切换版本。
例如,我为我的许多 .csproj 应用程序运行 dnvm use 1.0.0-rc1-update1
。
关于c# - 尝试在 EF7 beta6 中使用 'MissingMethodException' 时获取 'dnx . ef migration add',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31964824/