Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dnx ef 7 migration error with asp.net

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.

Edit: It seems just running dnx . ef alone gives the same error.

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 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.

like image 823
J.Krishna Avatar asked Sep 27 '22 04:09

J.Krishna


1 Answers

Change directory from solution folder to project folder with Migrations then run ef command.

I think for you will be J:\vsproj\AspNet.EF7\src\AspNet.EF7.

like image 61
Mariusz Avatar answered Oct 06 '22 02:10

Mariusz