My project solution is currently having three projects:
.NET Framework 4.7
) - WPF, UI specfic,.NET Standard 2.0
) - holding the models, and all of the 'behind the scenes' data.NET Standard 2.0
) - responsible for processing and saving the database specific informationsProject 1
(main) has set a reference to project 2
and 3
.
For the project 3
I have installed a NuGet
dependency of Microsoft.EntityFrameworkCore.Sqlite (2.0.3)
.
Now, when I finally want to make use of project 3
and call it's method, the following exception is being thrown:
System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.
This, of course is a missing DLL file - no entity framework DLL's are being copied to the app Debug
directory.
Why is that? Is this intended behaviour? Do I have to install the dependency of Microsoft.EntityFrameworkCore.Sqlite
for project 1
as well? Pretty pointless to me, referencing the same dependency to project that is making no use of it.
What have I tried:
copy local
to True
,Using Visual Studio 2017.
Solved this by adding the following line into my .csproj
file:
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
Specifically to the PropertyGroup
group.
Not sure why it makes such difference, if anyone could explain and post in the comment it would be great. Any additional informations I will add to this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With