-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix: Set Fallback for dotnetcore3.1 or net5.0 applications #1111
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So, .net6 is the latest version that's still supported:
https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core
This means if your project targets an EOL'd version of dotnet, you need to also have dotnet 8 runtime installed on your machine.
While this is a better fallback than just crashing with a path not found, I wonder if it's possible to log a warning here? Or at least update the troubleshooting docs so people know about it.
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.
There are enough projects that must remain on the 'netstandard2.0'. Such as Analyzer, Source Generators and many other project types, which of course also crash, unintentionally. Hence the fallback
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.
In addition, .NET 8 is the new LTS, so it is always installed on every system with the current VS version. This also means the maximum support period until we have to talk about a new fallback.
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.
My understanding of
$(NETCoreSdkVersion)
is that it is based on the version of the sdk that is performing the build. The current version of this does work when targetingnetstandard2.0
as long as it is being built with net6-8.There is a set of tests using docker that validate that - https://github.com/belav/csharpier/blob/main/Tests/MsBuild/Scenarios.json
Out of curiosity I updated them to run with net5 and netcore3.1 - #1112
They both fail with this type of message
So it does make sense that this should include a fallback or at least generate a more useful error/warning telling the user the problem.
Does a
global.json
that specifies an older version likenet5
result in$(NETCoreSdkVersion)
being that samenet5
version?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.
Okay, chances are people doing development will probably have at least one supported version of .net installed on their machine, so this is a good fallback in that case.
I'll merge this as is. @belav if you think having a better error message is worthwhile, we can track that as a separate issue.