I can't figure out how to create a package with references to a solution project and a third party assembly
I have a solution with 2 projects, A
and B
. B
references A
. Also, B
references C
which is a dll located in Solution/libs
A
and B
are supposed to be nuget packages.
I have a B.nuspec
file which is the following:
<?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>
I ran the following command:
nuget pack B.csproj -IncludeReferencedProject
As it is said in the nuget documentation, nuget will combine information from csproj and nuspec. However...
It gives me a nupkg with A.dll
and B.dll
in \lib\net45
and C.dll
in \lib
. Also there's a nuspec file
<?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>
And when I install the package into a project, none of A
, B
, C
are referenced.
What's wrong with my setup? Is there a way to create a package with dependencies taken from csproj and references specified manually (or maybe there's some hidden convention?)