我不知道如何创建一个引用解决方案项目和第三方程序集的包
我有一个包含 2 个项目的解决方案,A
并且B
. B
参考资料A
。此外,B
引用C
是位于Solution/libs
A
并且B
应该是nuget包。
我有一个B.nuspec
文件如下:
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>B</id>
<version>$version$</version>
<title>B</title>
<authors>me</authors>
<owners>me</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Description</description>
<copyright>Copyright © me 2016</copyright>
<references>
<reference file="C.dll" />
</references>
</metadata>
<files>
<file src="..\libs\RMS\C.dll" target="lib"/>
</files>
</package>
我运行了以下命令:
nuget pack B.csproj -IncludeReferencedProject
正如 nuget 文档中所说,nuget 将结合来自 csproj 和 nuspec 的信息。然而...
它给了我一个 nupkgA.dll
和B.dll
in\lib\net45
和C.dll
in \lib
。还有一个nuspec文件
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>B</id>
<version>1.0.31</version>
<title>B</title>
<authors>me</authors>
<owners>me</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Description</description>
<copyright>Copyright © me 2016</copyright>
<dependencies>
<dependency id="log4net" version="2.0.2" />
<dependency id="JetBrains.Annotations" version="9.2.0" />
<dependency id="morelinq" version="1.4.0" />
</dependencies>
<references>
<reference file="C.dll" />
</references>
</metadata>
</package>
当我将包安装到项目中时,没有A
引用B
, C
。
我的设置有什么问题?有没有办法使用从 csproj 获取的依赖项和手动指定的引用创建一个包(或者可能有一些隐藏的约定?)