efcore icon indicating copy to clipboard operation
efcore copied to clipboard

EF 7 beta 5 with ASP.NET 5 - dnx . ef - error Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1'

Open jkicha opened this issue 11 years ago • 3 comments

I am running ASP.NET 5 default project template with EF 7 beta 5 in Windows 10 preview. Inside Visual Studio, the project build is fine without any errors.

When running EF migration using dnx, it gives this error.

J:\vsproj\AspNet.EF7>dnx . ef 
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 command works fine without any error.

    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

Thanks for the help.

jkicha avatar Aug 03 '15 16:08 jkicha

Hey,

There doesn't appear to be anything EF specific here, it seems to be something in DNX that is not resolving dependencies. Any chance you could share your project so that we can verify?

~Rowan

rowanmiller avatar Aug 07 '15 17:08 rowanmiller

I'm seeing the same issue - Visual Studio 2015 RTM with beta5. Here's a default app with no other changes, and if you try dnx . ef you get the same error. https://github.com/JimLynn/DataTestApp

JimLynn avatar Aug 08 '15 23:08 JimLynn

After more digging, and testing, I've discovered the reason it's not working.

I got the error when I was in the root directory of my project. If I run the command in the src/ProjectName directory the command works as expected.

So a simple answer to what looks like a horrendously complex error.

JimLynn avatar Aug 09 '15 00:08 JimLynn