-
Notifications
You must be signed in to change notification settings - Fork 12
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
add DotnetFramework and DotnetCore features #87
Conversation
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.
Awesome code, just that one comment based on empty document possible problem.
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.
One more condition to consider is the global.json file that sets the version for all projects within a directory:
https://docs.microsoft.com/en-us/dotnet/core/tools/global-json?tabs=netcore3x
?? _csproj.GetElementsByLocalName(Constants.TargetFrameworkElement).FirstOrDefault() | ||
?? _csproj.GetElementsByLocalName(Constants.TargetFrameworksElement).FirstOrDefault(); |
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.
Can both TargetFramework and TargetFrameworks exist at the same time? If yes, this will not give a correct result
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.
Yes, it is technically valid for both TargetFramework
and TargetFrameworks
to exist in a .csproj file, but in those cases, TargetFrameworks
will be ignored (source)
@marknfawaz This is an interesting case. At first glance, it doesn't seem like global.json is coupled to a project and only customizes the CLI execution environment (as opposed to declaring the target framework inherent to the project). I don't think this is a case we'll need to factor in here, but I could be wrong. If my understanding is incorrect, we can talk discuss more in detail. |
Per our conversation, I will update the features to use the build result to get the target framework(s). |
Closing- obsolete |
Related issue
Closes: #83
Description
.csproj
files and uses regex patterns to identify the target framework typenetcoreapp.3.9
is an invalid target framework, but it would still register as a .NET Core project)Supplemental testing
Describe any testing done in addition to existing unit tests
Additional context
Sources of Target Framework patterns
.csproj
files.csproj
filesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.