dotnet / dotnet/msbuild

Referencing global MSBuildExtensionsPath32 but allow overriding Import/@Project

Open
#1,832 5 comments 2 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

We use a pattern like the following. At the top of the project is a property and at the bottom the `Import/@Project` uses that property. Simplified:



$(MSBuildExtensionsPath32)Our\stuff.targets



...

This pattern allows our users to set the `PathToTargetsFile` Property and redirect their build to a private install location for our tools.

With MSBuild15 this creates problems because the `$(MSBuildExtensionsPath32)` will *only* point to the private location with MSBuild15 and not fallback to the global location where the tools are installed by default.

We've done the work to create a VS2017 extension to install a "trampoline" `stuff.targets` inside the private MSBuild15 location out to the global install location. This works inside VS but on a build machine the VS2017 extension may not be installed or the MSBuild Build Tools SKU may be used and extensions are not allowed there.

The best idea we've come up with to address this is to change our template projects file to do the following:


The problem is that change will break all of our existing customers and force them to change *all* of their project files. :sob:

Is there any other option to better handle the breaking change introduced in MSBuild15?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.