Building NuGet packages with Visual Studio and MSBuild
C# Other
Clone or download
AArnott Merge pull request #296 from sagmor/issue-295
Prevent double import of Microsoft.Common.props
Latest commit 55350b5 Dec 16, 2017

Welcome to NuProj!

Join the chat at

dev version Issue Stats Issue Stats

NuProj provides MSBuild based support for creating NuGet packages (.nupkg).

Creating NuGet packages is as simple as:

NuGet.exe pack MyPackages.nuspec -basepath D:\source\bin

Well, except for the part where you need to integrate this into your build process.

NuProj allows defining the entire .nuspec file via a regular MSBuild project:

msbuild MyPackage.nuproj /p:BasePath=D:\source\bin

At first this might not look like a big deal but this gives you the following advantages:

  • Easy integration into existing build processes
  • No placeholder limitations -- every piece of information can be injected via the build process
  • Proper reporting of errors and warnings
  • Enables a Visual Studio Integration

Below is an example how HelloWorld.nuproj would look like:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
    <Description>Hello World</Description>
    <ReleaseNotes>Hello World</ReleaseNotes>
    <Summary>Hello World</Summary>
    <Copyright>Copyright (c) Immo Landwerth</Copyright>
    <Library Include="$(BasePath)HelloWorld.dll">
    <NuProjTargetsPath Condition=" '$(NuProjTargetsPath)' == '' ">$(MSBuildExtensionsPath)\NuProj\NuProj.targets</NuProjTargetsPath>
  <Import Project="$(NuProjTargetsPath)" />

Visual Studio Integration

Also, make sure to check out the Visual Studio Integration:

Visual Studio Integration


For more details, check out the documentation.