Skip to content

About

Company-agnostic MSBuild kit for .NET repos and NuGet packages: build defaults, nuget.org-ready packaging, versioning from release tags, tests and coverage.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DragoAnt.MSBuildKit

Shared MSBuild settings for .NET repositories that publish NuGet packages: nuget.org-ready package metadata with build-time checks, versions from release tags, and Microsoft.Testing.Platform tests with coverage. Installed as plain files you can read and review, updated by one script.

CI Release License

Key features

  • Packages that pass nuget.org's rules by default. Licence, icon, README, Source Link, symbols, repository and release-notes links, package validation and NuGet audit; nineteen MSKITPKG checks run on dotnet pack, warnings on your machine and errors on CI. Packaging
  • One README for the repository and its packages. MSKit_PackageReadmeFrom=README.md generates each package's readme on pack, with links pinned to the commit. Package readme
  • Versions from release tags. Tag v1.4.0 and the packages are 1.4.0; branch builds are 1.4.0-ci.<run>, pull requests 1.4.0-pr.<n>.<run>, local builds 9999.0.0. Versioning
  • Tests on Microsoft.Testing.Platform v2. Projects named *.Tests become xUnit v3 test projects with coverage, TRX and JUnit reports, an assertion library and NSubstitute. Testing
  • Build checks that keep a repository consistent. Target frameworks declared once, banned packages, prerelease dependencies on a stable branch, TreatWarningsAsErrors drift. Build defaults and checks
  • Plain files, one update script. The kit lives in your repository's .toolkit/ folder, so every change shows up in a pull request; update.sh / update.ps1 install a release after checking its SHA-256. It is not a NuGet package or an MSBuild SDK: nothing is restored at build time. Install and update

Install

From the repository root, with a POSIX shell or PowerShell 7:

curl -fsSLO https://github.com/DragoAnt/MSBuildKit/releases/latest/download/update.sh
sh update.sh && rm update.sh
Invoke-WebRequest https://github.com/DragoAnt/MSBuildKit/releases/latest/download/update.ps1 -OutFile update.ps1
pwsh ./update.ps1; Remove-Item update.ps1

Then declare the next version in Directory.Version.props and commit .toolkit/. Getting started walks through the first build, test and pack; samples/MinimalLibrary is a complete repository with every check passing.

Documentation

docs/README.md lists the pages in reading order. Every property is in the property reference, every warning and error in the code reference. Coming from MSBuild.Routine: migration guide.

Contributing

See CONTRIBUTING.md. Changes are listed in CHANGELOG.md.

License

MIT

About

Company-agnostic MSBuild kit for .NET repos and NuGet packages: build defaults, nuget.org-ready packaging, versioning from release tags, tests and coverage.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages