Fix NFE about version regression on configuration switch #9606
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 https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1833278
In #8321, we optimised how we handle Roslyn projects in the language service during configuration switches, such as from Debug to Release.
Before that PR, we maintained different pipelines for each configuration. That PR re-uses the same pipeline between configurations, instead applying a delta representing the switch. This makes configuration switches a lot faster.
Project data flows through with version numbers, and each configuration tracks versions to ensure that evaluation and build data is applied with correct sequencing.
The previous PR introduced the chance for an unexpected regression in configured project version, which would lead to an exception that'd trigger a NFE and gold bar in VS.
This is one of the top NFEs in the project system.
The fix here is to consider multiple versions in each update. We combine a version that increments when the active configuration changes along with the actual configured project version. Then, when comparing versions, we first compare the active configuration version, and only if they match would we then compare the configured project version. This gives us a monotonically increasing sequence of updates across both configuration switches and project changes, which will satisfy the consuming code and prevent the NFE.
Microsoft Reviewers: Open in CodeFlow