Let say I have a project that contains a packages.config file. Now when I run nuget pack myproj.csproj in the same folder as the packages.config that belongs to the project I expect nuget to include the dependencies, but that wasn’t the case. Is it possible to make it so somehow? Or do I have to create a nuspec file to get dependencies working?
Let say I have a project that contains a packages.config file. Now when I
Share
As far as I know, the latest version of the NuGet vsix supports this out-of-the-box.
If you enable package restore (to get the .nuget folder and msbuild scripts etc), you can add the following MSBuild property to your project file (edit the csproj file):
Now, whenever you build your project, a .nupkg file will be created in your project $(OutDir) whether you have a .nuspec file for the project or not. It will have all dependencies it found in your project’s packages.config file.
However, if you do have a .nuspec file in your project folder called {projectname}.nuspec (replace {projectname} with the project filename minus its extension), you’ll be able to add additional metadata and contents which can not be derived automatically just by looking at your project. Information on creating such file can be found here.