microsoft / microsoft/MSBuildSdks

[Feature Request] New MSBuildSdk to simplify creating an MSBuild task package

Open
#551 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
508
Forks
94
Avg merge
6h 40m
Merged PRs (30d)
2

Description

The Problem

The general steps to create a NuGet package that contains MSBuild tasks is outlined here: https://learn.microsoft.com/en-us/visualstudio/msbuild/tutorial-custom-task-code-generation?view=vs-2022#package-the-task-for-distribution

This process requires 8 steps:

  1. Set CopyLocalLockFileAssemblies
  2. Mark all PackageReferences with PrivateAssets="All"
  3. Add the CopyProjectReferencesToPackage target
  4. Set the BuildOutputTargetFolder
  5. Suppress NU5100 and NU5128
  6. Mark Microsoft.Build.* assemblies with ExcludeAssets="runtime"
  7. Set GenerateDependencyFile and add target to copy to output directory
  8. Add the build/, buildTransitive/, buildMultiTargeting/ folders to the package

and I always forget at least one when creating a new project.

The Proposal

Create a new SDK to centralize these steps, and ideally update the docs to point to the SDK instead. In addition to lowering the barrier to authoring MSBuild tasks, centralizing the process for creating an MSBuild task package will make it easier for authors to follow best practices as they evolve (similar to the DotNet.ReproducibleBuilds packages).

I'm happy to do this work myself, but wanted to get approval before starting. Thoughts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Microsoft documentation and review the eight listed packaging steps that the proposed SDK should centralize. Compare them with the repository's existing project SDK conventions, then define the SDK scope and update the documentation to reference it when the packaging workflow is covered.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.