Automating creating NuGet package as part of build process

前端 未结 9 1846
伪装坚强ぢ
伪装坚强ぢ 2020-12-22 18:05

I have an automated build process that I\'d like to extend so I can build the libraries I am distributing via NuGet. Currently, running nuget.exe to create the packages is

9条回答
  •  -上瘾入骨i
    2020-12-22 18:18

    A simple suggestion that might work good enough... just put it as Postbuild event into the .csproj file:

      
        $(SolutionDir)\NuGet.exe pack $(ProjectPath) -OutputDirectory ..\..\$(OutDir) -IncludeReferencedProjects -Symbols -Properties Configuration=$(Configuration)
      
    

    This will collect your custom .nuspec file (that needs to be named like the .csproj file) and build the .nupkg.

    Thats it.

    You can even do this simply within the Visual Studio Project settings.

提交回复
热议问题