I have a .NET Standard 2.0 project which uses EF Core via the Nuget package Microsoft.EntityFrameworkCore. Below is the relevant PropertyGroup from the *.csproj file:
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.4" />
</ItemGroup>
The solution builds, but at runtime, I get a System.IO.FileNotFoundException:
Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.1.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies.
That assembly is not in the build folder (or any subfolders such as the netstandard2.0 subfolder). It is in %userprofile%\.nuget\ ...
I have tried:
- Cleaning / Rebuilding
- Clearing the Nuget cache.
- Adding
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
to the *.csproj file. - Removing and re-adding Micrososft.EntityFrameworkCore (and Microsoft.EntityFrameworkCore.Design, which is also used)
Is there some other way of forcing the package to be included in the build folder (like Local Copy)?