dotnet / dotnet/msbuild

ToolsVersion should be ignored by MSBuild task

Open
#4,319 3 comments 2 reactions 0 assignees View on GitHub
Area: Engine Breaking Change triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

MSBuild ignores ToolsVersion in most places but the MSBuild task is still trying to honor it

### Steps to reproduce

If you specify an invalid ToolsVersion to an MSBuild task invocation, the build will fail:

Project file
```xml





```
Command line
```
msbuild /bl
```
### Expected behavior
ToolsVersion to not be respected and ignored like ToolsVersion is ignored everywhere else.

### Actual behavior
Build error:
```
error MSB4132: The tools version "BadToolsVersion" is unrecognized. Available tools versions are "Current", "2.0", "3.5", "4.0".
```

### Environment data
`msbuild /version` output:
```
Microsoft (R) Build Engine version 16.1.59-preview+gd8f1537cf1 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

16.1.59.61912
```

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.