【发布时间】:2018-04-17 18:23:47
【问题描述】:
我使用 Nuget 包资源管理器创建了一个 Nuget 包。该软件包有一些我在代码中使用的第三方 dll。我的 dll 包含在 Nuget 包中,而不是在项目引用中直接引用。 Nuget 包具有以下内容。
- thirdPartyAAA.dll
- thirdPartyAAA.xml (Needed by thirdPartyAAA.dll)
- thirdPartyBBB.dll (needed by thirdPartyAAA.dll
- thirdPartyBBB.dll.config (used by thirdPartyBBB.dll)
- Dependency on HtmlAgilityPack nuget (Needed by thirdPartyAAA.dll)
- Dependency om RestSharp nuget (Needed by thirdPartyAAA.dll)
问题是:当我在代码中引用这个 Nuget 包并编译代码时,我只在 bin 输出文件夹中得到 aaa.dll。 bin 文件夹中缺少以下文件:
- thirdPartyAAA.xml
- thirdPartyBBB.dll
- thirdPartyBBB.dll.config
- All dlls from HtmlAgilityPack nuget
- All dll from RestSharp nuget
在我的代码中,我直接引用了thirdPartyAAA.dll。
有没有办法——无论是在创建 Nuget 包期间还是在引用包时——强制 Nuget 包恢复其所有内容及其依赖项?我需要恢复 Nuget 包中包含的所有文件,无论它们是否直接在代码中引用。
感谢大家的帮助。 如果有帮助,这是包的清单。
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MyPackage</id>
<version>1.0.0</version>
<title></title>
<authors>Dev</authors>
<owners>Dev</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>My package description.</description>
<dependencies>
<dependency id="HtmlAgilityPack" version="1.4.9" />
<dependency id="RestSharp" version="105.0.1" />
</dependencies>
</metadata>
<files>
<file src="content\thirdPartyAAA.chm" target="content\thirdPartyAAA.chm" />
<file src="content\thirdPartyAAA.XML" target="content\thirdPartyAAA.XML" />
<file src="content\thirdPartyBBB.dll.config" target="content\thirdPartyBBB.dll.config" />
<file src="lib\thirdPartyAAA.dll" target="lib\thirdPartyAAA.dll" />
<file src="lib\thirdPartyBBB.dll" target="lib\thirdPartyBBB.dll" />
</files>
</package>
【问题讨论】:
-
这个问题有什么更新吗?你解决了这个问题吗?如果没有,请告诉我有关此问题的最新信息吗?
标签: c# visual-studio-2017 nuget nuget-package-restore