dotnet / dotnet/sdk

[DX] SDKs behavior should not change between <TargetFramework>x</TargetFramework> and <TargetFrameworks>x</TargetFrameworks>

Open
#53,410 0 comments 1 reaction 0 assignees View on GitHub
untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Is your feature request related to a problem? Please describe.
If I replace `net10.0` element with `net10.0` SDK treats my porject as having multiple TFMs. For example `dotent publish` fails and requires specifying TFM with `-f` option.

### Describe the solution you'd like
When `net10.0` specifies only single TFM there should not be noticable change in behavior of the tools.

### Additional context
**Why do we need it?**

In some solutions we have to multitarget some projects to support .netstandard 2.0 for legacy consumers of our clients.
Thus, it's conveniet for us to specify main framework in `Directory.Build.props`:
```
net10.0
```
and in porj file of a multitargeted project:
```
netstandard2.0;$(TargetFrameworks)
```

When we migrate to newer version we need to update version in multiple places. If we are forced to specify target framework in `dotnet publish` there's one more place to miss and forget. This a bad vibe for Developer Experience.

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.