dotnet / dotnet/msbuild

UWP project reference fail when setting TargetPlatformMinVersion.

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

Description

### Issue Description

UWP project reference fail when setting `TargetPlatformMinVersion`: `The target "GetTargetPath" does not exist in the project.`

### Steps to Reproduce
Create a multi-targeted project like this:
```xml


netstandard2.0;uap10.0.19041
10.0.17763.0

```
Next create a second project that references this:
```xml


uap10.0.19041
10.0.17763.0



```
This causes the build error
> 2>E:\sources.tmp\BuildRepro\Common\Common.csproj : error MSB4057: The target "GetTargetPath" does not exist in the project.
> 2>Done building project "Common.csproj" -- FAILED.

If you remove TargetPlatformMinVersion or set it to 19041 on the second project, the problem goes away.
If you replace the second project with a classic UWP class library project, there is no issue.
If you change `TargetFramework` to `TargetFrameworks` (plural) problem goes away, but it seems inconsistent that a single-targeted project must be using the plural version.

### Expected Behavior
Project builds, regardless of minversion or whether `TargetTramework` setting is plural or not..

### Actual Behavior
error MSB4057: The target "GetTargetPath" does not exist in the project.

### Analysis

I didn't find any indication this is an issue with `MSBuild.Sdks.Extras`

### Versions & Configurations
vs17.3, Windows 10 and 11

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.