我正在运行ASP.NET 5默认项目模板,使用EF 7 beta 5在Windows 10预览版中。在Visual Studio中,项目构建正常,没有任何错误。
当使用dnx运行EF迁移时,它会出现以下错误。
编辑:似乎仅运行dnx . ef
也会出现相同的错误。
J:\vsproj\AspNet.EF7>dnx . ef migration add Intial
System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1':
EntityFramework.Commands 7.0.0-beta5
EntityFramework.SqlServer 7.0.0-beta5
Microsoft.AspNet.Authentication.Cookies 1.0.0-beta5
Microsoft.AspNet.Authentication.Facebook 1.0.0-beta5
Microsoft.AspNet.Authentication.Google 1.0.0-beta5
Microsoft.AspNet.Authentication.MicrosoftAccount 1.0.0-beta5
Microsoft.AspNet.Authentication.Twitter 1.0.0-beta5
Microsoft.AspNet.Diagnostics 1.0.0-beta5
Microsoft.AspNet.Diagnostics.Entity 7.0.0-beta5
Microsoft.AspNet.Identity.EntityFramework 3.0.0-beta5
Microsoft.AspNet.Mvc 6.0.0-beta5
Microsoft.AspNet.Mvc.TagHelpers 6.0.0-beta5
Microsoft.AspNet.Server.IIS 1.0.0-beta5
Microsoft.AspNet.Server.WebListener 1.0.0-beta5
Microsoft.AspNet.StaticFiles 1.0.0-beta5
Microsoft.AspNet.Tooling.Razor 1.0.0-beta5
Microsoft.Framework.Configuration.Abstractions 1.0.0-beta5
Microsoft.Framework.Configuration.Json 1.0.0-beta5
Microsoft.Framework.Configuration.UserSecrets 1.0.0-beta5
Microsoft.Framework.Logging 1.0.0-beta5
Microsoft.Framework.Logging.Console 1.0.0-beta5
Microsoft.VisualStudio.Web.BrowserLink.Loader 14.0.0-beta5
Searched Locations:
J:\vsproj\{name}\project.json
J:\vsproj\AspNet.EF7\src\{name}\project.json
J:\vsproj\AspNet.EF7\test\{name}\project.json
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\{name}.dll
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\{name}.dll
C:\WINDOWS\Microsoft.NET\assembly\GAC_32\{name}\{version}\{name}.dll
C:\WINDOWS\Microsoft.NET\assembly\GAC_64\{name}\{version}\{name}.dll
C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\{name}\{version}\{name}.dll
Try running 'dnu restore'.
at Microsoft.Framework.Runtime.DefaultHost.GetEntryPoint(String applicationName)
at Microsoft.Framework.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
at Microsoft.Framework.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
at dnx.host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env)
at dnx.host.RuntimeBootstrapper.ExecuteAsync(String[] args)
at dnx.host.RuntimeBootstrapper.Execute(String[] args)
dun restore命令正常运行,没有任何错误。
J:\vsproj\AspNet.EF7>dnvm list
Active Version Runtime Architecture Location Alias
------ ------- ------- ------------ -------- -----
1.0.0-beta5 clr x64 C:\Users\krishna\.dnx\runtimes
* 1.0.0-beta5 clr x86 C:\Users\krishna\.dnx\runtimes default
1.0.0-beta5 coreclr x64 C:\Users\krishna\.dnx\runtimes
1.0.0-beta5 coreclr x86 C:\Users\krishna\.dnx\runtimes
感谢您的帮助。