Use nuget package instead of project reference Visual studio

Viewed 33

We have a solution with 7 to 8 different projects including class libraries and mvc apps. We are using .net 4.6.2 and netstandard 2.0.

We are trying to convert class libraries to nuget packages and instead of referencing the projects directly in our web apps, use nuget packages. We have created the packages and added them in packages.config and the packages are getting installed perfectly fine.

Now, when I remove previous reference and add a new reference and point it to the nuget package, my web apps doesn't work and give assembly not found error.

I think I'm not adding the reference correctly , and need help on this.

1 Answers

If you are using NuGet packages now then you would install the package into each project which needs the assemblies and NuGet will add the references for you. You don't add the references by adding them from the packages directory.

E.g. Install-Package MyPackage MyProject

Related