-
Notifications
You must be signed in to change notification settings - Fork 87
Set default TFM for Traversal to SDK version #610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Set default TFM for Traversal to SDK version #610
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! |
--> | ||
<TargetFramework Condition="'$(TargetFramework)' == ''">net45</TargetFramework> | ||
<TargetFramework Condition=" '$(TargetFramework)' == '' And '$(NETCoreAppMaximumVersion)' != ''">net$(NETCoreAppMaximumVersion)</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about something like netstandard1.0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
net45
feels 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.