簡體   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