Set default TFM for Traversal to SDK version#610
Set default TFM for Traversal to SDK version#610MattKotsenas wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Fixes microsoft#602. Defaulting to `net45` feels odd, as it means folks are taking _new_ dependencies on .NET Framework without realizing it. It can also lead to oddities like microsoft#602 where old defaults apply to newer projects. This change allows the user to specify a particular version as before. However, otherwise `$(NETCoreAppMaximumVersion)` becomes the default version. I think this strikes a better balance, where users that care or need a specific version continue to do so, while those that consider Traversal projects more a facility of the build system get a more modern default.
|
As someone that's helping teams adopt traversal projects across an assortment of repos, this is something that comes up way more often than you might expect. The TFM shows up in binlogs and NuGet lock files, and devs often mistakenly think traversal projects are old or not well supported. |
|
/cc @AndyGerlicher for review, please. Thanks! |
| not set, fallback to the SDK's old default of .NET Framework v4.5. | ||
| --> | ||
| <TargetFramework Condition="'$(TargetFramework)' == ''">net45</TargetFramework> | ||
| <TargetFramework Condition=" '$(TargetFramework)' == '' And '$(NETCoreAppMaximumVersion)' != ''">net$(NETCoreAppMaximumVersion)</TargetFramework> |
There was a problem hiding this comment.
What about something like netstandard1.0 ?
There was a problem hiding this comment.
That would be an improvement over net45, but it doesn't fix the linked bug.
Targeting old netstandard means we're still opt-ed out of modern defaults like defaulting to Release for publish and pack.
There was a problem hiding this comment.
Another alternative would be to find a solution for the project templates. Then we could default to the current SDK version in the template.
I also prefer that option a bit less since it means every Traversal would set the TFM which clutters things a bit, but it'd be less magical.
Fixes #602.
Defaulting to
net45feels odd, as it means folks are taking new dependencies on .NET Framework without realizing it. It can also lead to oddities like #602 where old defaults unexpectedly apply to newer projects.This change allows the user to specify a particular version as before. Otherwise
$(NETCoreAppMaximumVersion)becomes the default version.I think this strikes a better balance, where users that care or need a specific version continue to do so, while those that consider Traversal projects more a facility of the SDK / build system get a more sensible default than a version released 13 years ago.