Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

ASP.NET Core EF migration not working #1474


User avatar
0
acrigney created

Great to see you are getting into ASP.NET Core but the migration is looking for a .dll however I see that a (Project.EntityFrameworkCore.exe is being created instead? Here is the output from the Package Manager Console \Projects\Products\src\TrueAlliance.Products.Web\Views\Shared\Components\LanguageSelection\LanguageSelectionViewComponent.cs(19,49): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. Could not find assembly '.\bin\src\TrueAlliance.Products.Web\bin\Debug\net461\win7-x86\TrueAlliance.Products.EntityFrameworkCore.dll'.

PM> Add-Migration "Initial" Could not find assembly '.\bin\src\TrueAlliance.Products.Web\bin\Debug\net461\win7-x86\TrueAlliance.Products.EntityFrameworkCore.dll'.


2 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    See this: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnet-core-template/blob/dev/src/AbpCompanyName.AbpProjectName.EntityFrameworkCore/Program.cs#L3">https://github.com/aspnetboilerplate/as ... gram.cs#L3</a>

    .NET CLI does not support class library projects yet. So, we did it as exe instead of dll.

    I'll try it again. Have you tried to use this command from command line:

    dotnet ef migrations add "Initial"
    
  • User Avatar
    0
    acrigney created

    Sorry for rushing this! Yes you just need to change directory in the package management console first then you can do the migration comand. dotnet ef migrations add "initial"