sdk
sdk copied to clipboard
Feature Request: Allow format to select only one framework in case of multi-target projects
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.
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.
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.
Just started bumping into these "Unmerged change from project" errors as well.
As per the original request, if it's possible to specify a TFM to avoid this, that would be way better than having the tool get confused and add a bunch of verbose comments to the code.