I want to run a local/internal NuGet repository. I think I've figured out how to "reuse" existing NuGet packages by including them in a dummy project using NuGet and scanning the package file to grab my locally-cached .nupkg
files, but...
How do you create a nuget package (.nupkg
) from a project, automatically including alldll
dependencies and not just those grabbed via NuGet?
Specifically:
- Create a solution
- Add a new Project
- Add references to various
.dll
files/other projects <-- this is the missing part - Add NuGet packages via package manager / cmdline / whatever
- something automatically creates the
.nupkg
From what I've found, you're supposed to do things like
- manually edit your
.csproj
file to add<BuildPackage>true</BuildPackage>
to include dependencies - manually create a
.nuspec
file and manually list your dependencies (similar ?) - manually run
nuget pack
on your.nuspec
file
But everything is manual, which is stupid. Even the semi-automatic solutions are still awkward or half-manual:
- Create
.nuspec
templates - doesn't seem to include dependencies, just metadata nuget pack via build-event (step #5), which you need to add manually to every project, and it has its own quirks:
"$(SolutionDir).nuget\NuGet.exe" pack "$(ProjectPath)" -Properties Configuration=Releasemove /Y *.nupkg "$(TargetDir)"
I'll settle for something that automatically creates a .nuspec
manifest from project references. Then theoretically that + the nuget build-event can be rolled up into a build-project/nuget package, which is what I really want to see.