I am running a private Nuget server locally in IIS. I create packages and download them all via commadline using nuget.exe (Later I have to put this on the build server, and therefore on the command line). However, there is one problem I'm stuck with.
I am trying to declare dependencies. I am creating a nuspec file in a folder where there is a .csproj file. Then I will manually edit the nuspec file to add it under the metadata tag:
<metadata> <dependencies> <group targetFramework=".NETFramework4.5"> <dependency id="DemoProject" version="2.0.0.0" /> </group> </dependencies> </metadata>
DemoProject, version 2.0.0.0 is present on the Nuget server. The project for which I am creating a package for MyProj.csproj does not contain references to DemoProjects added to it through Visual Studio. I just want to create a dependency. This sounds strange, but necessary for some initial verification.
Then I run the pack command:
"C: \ nuget \ NuGet.exe" package MyProj.csproj -IncludeReferencedProjects -Prop Configuration = Release
Then I push it to the NuGet server using the command line. When I perform the installation through the command line, then only the MyProj package is present at the installation location.
When I use Nuget Package Explorer and create a package, I can use the package dependency editor to specify the dependency. It requests the URL of my local Nuget server, and then adds the dependency. And when I install this package, it works !!
There seems to be no difference in the generated nuspec file in both cases. Obviously, the Nuget package manager does what I miss.
Any clues?
Details: When I create the lib folder in the package manager console and put my dll manually, lib-> net45-> MyProj.dll, then when I install the package created in this way, it also doesnβt install the dependency. Return to the documentation to read again.