From 4217e7ef64531269cf41ff321db09d82c19a2657 Mon Sep 17 00:00:00 2001 From: Rainer Sigwald Date: Thu, 13 May 2021 16:07:47 -0500 Subject: [PATCH] Add solution-validation targets as hook points Solution metaprojects are assembled in a confusing way that impacts what targets can be hooked into via BeforeTargets/AfterTargets. Prior to this change one couldn't hook before the build would attempt to traverse the list of projects in the solution. Extend the "list of targets we know we'll create shortly" list to include the things that are in the `InitialTargets` list and `GetSolutionConfigurationContents`. Fixes #6452. --- src/Build/Construction/Solution/SolutionProjectGenerator.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Build/Construction/Solution/SolutionProjectGenerator.cs b/src/Build/Construction/Solution/SolutionProjectGenerator.cs index 3888a265e50..106c852d064 100644 --- a/src/Build/Construction/Solution/SolutionProjectGenerator.cs +++ b/src/Build/Construction/Solution/SolutionProjectGenerator.cs @@ -66,7 +66,11 @@ internal class SolutionProjectGenerator "Build", "Clean", "Rebuild", - "Publish" + "Publish", + "ValidateSolutionConfiguration", + "ValidateToolsVersions", + "ValidateProjects", + "GetSolutionConfigurationContents" ); #if FEATURE_ASPNET_COMPILER