I have three Dotnet Core 2.0 projects; Angular, Domain and EF7. Domain and EF7 are .NETStandard libraries, Angular is the Core 2.0 Angular web project template. Please note that despite the project name, EF7 is using Entity Framework Core 2.01, not Entity Framework 7.
I tried to run migrations today after some major changes (and after deleting the old migrations folder, as its still a project in development). I receive the following error:
Could not load file or assembly 'EF7, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
I am completely baffled as to where this error came from. It worked last week and I have not touched the EF packages or altered the EF7 project's properties, thus it is still built as neutral and unsigned.
This is the command I run from the command line within the EF7 folder.
dotnet ef migrations add Initial --startup-project ..\Angular
Add-Migration Initial from the package manager console in Visual Studio gives the same error.
The EF7 csproj file contains the requisite tools for CLI and PMC.
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1" /> <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1" />
The project runs perfectly fine and I can view it in my browser, it is only the migration tools that fail.
You could try this tool to find the cause of the issue: https://marketplace.visualstudio.com/items?itemName=MykolaTarasyuk.ReferenceConflictsAnalyser