MSBuildInfo 0.4.1

dotnet add package MSBuildInfo --version 0.4.1
                    
NuGet\Install-Package MSBuildInfo -Version 0.4.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MSBuildInfo" Version="0.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MSBuildInfo" Version="0.4.1" />
                    
Directory.Packages.props
<PackageReference Include="MSBuildInfo" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MSBuildInfo --version 0.4.1
                    
#r "nuget: MSBuildInfo, 0.4.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MSBuildInfo@0.4.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MSBuildInfo&version=0.4.1
                    
Install as a Cake Addin
#tool nuget:?package=MSBuildInfo&version=0.4.1
                    
Install as a Cake Tool

MSBuildInfo

NuGet version (MSBuildInfo)

Generate json with build information during build.

When building your project in your prefered CI pipeline, I found that getting information about the build could sometimes be valueable - but hard to extract.

This is where MSBuildInfo comes in handy. Just add the NuGet to your project and it will start generating BuildInfo.json on every build.

Customise

You can add you own build properties to the BUildInfo.json. This can be done in one of two ways.

Either you can add this file next to you project file (.csproj): BuildInfo.build.targets.

You can also add the content directly to your project (.csproj) file

<Target Name="GenerateBuildInfo">
  <PropertyGroup>
    <CustomValue>This is my value</CustomValue>
  </PropertyGroup>
  <ItemGroup>
    <BuildInfo Include="CustomInfo" Value="$(CustomValue)" />
    <BuildInfo Include="TestVariable" Value="$(TestVariable)" />
  </ItemGroup>
</Target>

In both cases you just add more entries of

<BuildInfo Include="Key" Value="Value" />

You cannot do both. MSBuild will only pick up the one defined last in the build process.

Generate Build Info

You can generate the BuildInfo.json without building your project. This can come in handy if you need info about your build configuration without waiting for the entire build.

dotnet build -t:MSBuildInfo

TLDR;

Reference this NuGet and add this file next to you project file (.csproj): BuildInfo.build.targets.

Look for the generated BuildInfo.json in your output folder.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.1 523 11/19/2025
0.3.2 362 11/16/2025
0.3.1 332 11/14/2025
0.3.0 335 11/14/2025