Let's say I have a visual studio 2019 solution containing two projects written in C#, one of which is a console app and the other one is a class library.
The console app now has a reference to the class library which by itself needs entity framework, for example.
The question is, is there a way on how to include the entity framework within the class library so that the console app only needs a reference to the class library and not to the entity framework as well?
is there a way on how to include the entity framework within the class library so that the console app only needs a reference to the class library and not to the entity framework as well?
Steps to add references in console app as well as in class library:
Add required NuGet packages to class library project using Manage NuGet Packages..
option available when you right click on references in class library project.
Now add class library project reference to console application using Add Reference
-> Projects
-> Solutions
.
In this way you need not to add dependent assemblies to console application. Whenever you update in class library project it will get reflected to console application after rebuilding the solution.