简体   繁体   中英

Use nuget package instead of project reference Visual studio

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.

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.

Eg Install-Package MyPackage MyProject

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM