Provides a NuGet package that adds functionality to your project to auto pack and publish to a private nuget server the project as a nuget package.
Remarks: This works only with nuget.exe
executable and is designed for .NET Framework projects. Not for .NET Core
Nuget package: https://www.nuget.org/packages/MSBuild.PublishNuget.Target
Install-Package MSBuild.PublishNuget.Target
- Add the package to the project.
- Make sure you have the
nuget.exe
executable in your path (i.e. Open a command prompt and typenuget help
and check if the version of nuget is displayed). - You can download the most recent version of
nuget.exe
at NuGet downloads page. - Open your
.csproj
and add the following property group to the file:
<PropertyGroup>
<PackageAPIKey>{{YOUR PRIVATE NUGET FEED KEY}}</PackageAPIKey>
<PackageServer>{{YOUR PRIVATE NUGET FEED URL}}</PackageServer>
<PackageDir>{{ DIRECTORY TO GENERATE THE .NUPKG }}</PackageDir>
<PackageIncludeReferencedProjects>true</PackageIncludeReferencedProjects>
</PropertyGroup>
- Put your own data (Feed API Key and Feed Url).
- Set the directory where the package will be generated
- Set true or false toinclude referenced projects (if ommited will be set to false)
- Save the
.csproj
. - On Visual Studio, change the current configuration to
Release
if isn't yet. - Build!