dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.6k stars 1.03k forks source link

Feature Request: Allow format to select only one framework in case of multi-target projects #41899

Open zhiyuanliang-ms opened 5 days ago

zhiyuanliang-ms commented 5 days ago

Migrate #2057 to SDK repo

Is your feature request related to a problem? Please describe.

Why this feature is needed:. When run 'dotnet format' in multi target project, there may cases where format tool can not merges the changes in multi frameworks eg net6, net472 and had to add unhelpful comments like:

/* Unmerged change from project 'xxxx (net6.0)'
 Before:

 After:

 */

Even worse, the unmerged change will not be logged.

See #1634

Describe the solution you'd like

It is great if we can avoid such problems by passing framework option in commandLine , e.g:

dotnet format --framework net472

Additional context

This behavior makes dotnet format unuseable for multi-target projects.

dotnet-issue-labeler[bot] commented 5 days ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

dotnet-issue-labeler[bot] commented 5 days ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.