[英]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.我们有一个包含 7 到 8 个不同项目的解决方案,包括 class 库和 mvc 应用程序。 We are using .net 4.6.2 and netstandard 2.0.
我们正在使用 .net 4.6.2 和 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.我们正在尝试将 class 库转换为 nuget 包,而不是直接在我们的 web 包中引用项目,而是使用 Z0557844081469C782 包。 We have created the packages and added them in packages.config and the packages are getting installed perfectly fine.
我们已经创建了包并将它们添加到 packages.config 中,并且包安装得非常好。
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.现在,当我删除以前的引用并添加新的引用并将其指向 nuget package 时,我的 web 应用程序不起作用并给出未找到装配错误。
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.如果您现在正在使用 NuGet 包,那么您可以将 package 安装到需要程序集的每个项目中,NuGet 将为您添加参考。 You don't add the references by adding them from the packages directory.
您不会通过从包目录中添加引用来添加引用。
Eg Install-Package MyPackage MyProject例如 Install-Package MyPackage MyProject
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.