繁体   English   中英

每当我在NetStandard Library Project中使用Nuget包时,是否都必须将DLL从Nuget包复制到输出目录中?

[英]Do I have to copy the DLLs from the Nuget Package to the output directory everytime I use the Nuget Package in NetStandard Library Project

我有一个NetStandard库项目,它在lib \\ netstandard2.0项目中使用带有dll的Nuget包。 现在,当我构建该项目时,dll不会复制到输出目录中,从而导致

Could not load file or assembly 'ProjEntry, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

而当我在构建的Net Framework库项目中使用此Nuget软件包时,它将所有dll复制到输出目录。

在NetStandard Library Project中是否需要做任何特殊设置?

这是我的部分

<!--NetStandard-->
<file src ="ProjImpl\bin\Release\netstandard2.0\ProjImpl.dll" target ="lib\netstandard2.0\ProjImpl.dll"/>
<file src="ProjImpl\bin\Release\netstandard2.0\ProjImpl.pdb" target="lib\netstandard2.0\ProjImpl.pdb" />
<file src="ProjEntry\bin\Release\netstandard2.0\ProjEntry.dll" target ="lib\netstandard2.0\ProjEntry.dll"/>
<file src="ProjEntry\bin\Release\netstandard2.0\ProjEntry.pdb" target="lib\netstandard2.0\ProjEntry.pdb" />

在解决方案资源管理器中打开references文件夹,右键单击有问题的引用(例如nuget包),然后滚动到属性。 然后,确保对“ True”的引用的“ Copy Local”属性。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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