i have the following setting:
Now, when i run
nuget spec
the B.nuspec is created.
Then i run
nuget pack B.csproj -verbose
but in the created B-package, their is NO dependency to the A-package. The nuget pack command tells me that it has found the packages.config file (which contains the dependency to the A-package), but then it says "Dependencies: None".
What am i missing? Could the problem be that the A-package can only be found in my local package repository? How can i make nuget.exe aware of this local repository?
Thanks a lot!
Install NuGet packages without dependenciesBy default, when installing NuGet packages, corresponding package dependencies will also be installed in your project. To avoid the installation of dependent packages, choose the Ignore Dependencies option in the Dependency behavior drop-down in NuGet Package Manager.
Indicates that the built package should include referenced projects either as dependencies or as part of the package. If a referenced project has a corresponding . nuspec file that has the same name as the project, then that referenced project is added as a dependency.
Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.
nuget pack
needs to be able to find the packages
folder in order to resolve dependencies (see http://nuget.codeplex.com/workitem/3097), either in the same folder as the .csproj (as long as there's a .sln
file one level above it) or in a folder specified in NuGet.Config
.
I think I may have figured this out...
Our library solution had Nuget Package Restore turned on. I turned off NuGet Package Restore, and after that the project dependences were included when I created the NuGet packages.
I'm not really sure why the dependencies were not included in the package when Package Restore was turned on, but oh well :).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With