簡體   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