Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid bug during FUTDC validation after solution build completes
In some cases (such as when FUTDC logging is enabled) we run a validation pass to report to the user when their projects appear out of date despite just having been built. This feature alerts users to overbuild and provides useful diagnostic information to correct it. dotnet#9130 fixed a bug related to F5 builds. It introduced a race condition that can lead to the error reported in dotnet#9152. Our `CurrentSolutionBuildContext` value is set when the SBM starts the solution build, and cleared to `null` when it completes. Our validation logic runs async, and can complete after the SBM completes. In such cases, it can observe a null `CurrentSolutionBuildContext` value, which is not supported by the current code. This change captures the `CurrentSolutionBuildContext` value early on to ensure it's non-null when we need it later on, and passes the specific value down, preventing any issues from null values.
- Loading branch information