add tests to cover the resolution of AnalysisLevel known-strings #25454
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.
Fixes #25450 by
previewterm to a target TFMPotential enhancements I'd like some feedback on:
right now I'm hard-coding the 3 known string AnalysisLevel values. Is there an enum of these available somewhere to reference? Guessing not, since this is entirely an MSBuild-level construct. Resolution: just hard-coded them for now.
the 'preview floats to the next TFM' test currently hard-codes 8.0. I would love to be able to get the TFM we're built for at runtime somehow. anyone know how to do this? maybe a custom AssemblyAttribute? Resolution: Used the ToolSetInfo to ensure that when we bump our concept of 'next' and 'current' TFMs the sentinel test will break, so we will have to update this implementation.
currently it's hard to tell the user the valid values of the AnalysisLevel property via MSBuild warnings or errors, because all of this calculation happens as part of property evaluation. Other .targets files do this property evaluation inside of a target to allow for creating NETSDK errors. Is it worth trying to move in that direction? What I'm trying to fix is unknown AnalysisLevels getting passed into a TFM version evaluation because of this condition:
Resolution: too hard and error prone to do - will discuss with SDK/MSBuild team for a later date