Skip to content

Publish Sdk package for Common props/targets #1686

Open

Description

@rainersigwald

In the v14 extensibility model, MSBuild distributed many props and targets as part of its own installer, SDK authors installed files into known locations, and project files imported props and targets using paths relative to the MSBuild install root.

With the advent of Sdks, projects no longer need to specifically specify a path but can address an Sdk by name and version. However, Sdks that wish to opt into common functionality (i.e. all Sdks) still import the core MSBuild targets by the old mechanism that assumes they are next to MSBuild, for example:

<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />

Instead, MSBuild could publish a "Core Sdk" containing a copy of these files, and Sdks could explicitly depend on a versioned copy.

That has two effects, after Sdk version identification is complete:

➕ An Sdk version reference is stable and should work identically on different MSBuild engines (barring changes in behavior).
➖ Merely updating to a new CLI/MSBuild doesn't get you the latest bugfixes/extensibility points from new common targets.

Activity

  1. rainersigwald commented on Feb 9, 2017

    @rainersigwald
    MemberAuthor

    I was talking to someone about this offline, but I've forgotten who. @piotrpMSFT, maybe?

  2. added this to the Feature: Sdks milestone on Feb 9, 2017
  3. Nirmal4G commented on Feb 26, 2018

    @Nirmal4G
    Contributor

    I had done similar in my project! Here's the link if you're interested: MSBuild.Common.Sdk folder in MSBuild-Sdks repo.

    I wanted a single build tools kit for all my projects and I was inspired by .NET SDK and MSBuild.Sdk.Extras!

    Note:

    • All I did was refractor the old stuff and add some new stuff that was due for MSBuild, required to make it work for me! I'm still learning MSBuild, so, it may not be what you expect.
    • The MSBuild.NET.Legacy.Sdk project was just an experiment to redirect the legacy props/targets to the Sdk package. The other packages are also an experiment to learn the old-stuff and try-out new stuff!
  4. cdmihai commented on Apr 19, 2018

    @cdmihai
    Contributor

    Thank you @Nirmal4G for sharing your sdks!
    @jeffkl created the following repository for msbuild sdks: https://github.com/Microsoft/MSBuildSdks. Feel free to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions