繁体   English   中英

在尝试使用'dnx时获取'MissingMethodException'。 ef migration'添加'在EF7 beta6中

[英]Getting 'MissingMethodException' when trying to use 'dnx . ef migration add' in EF7 beta6

我正在尝试在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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM