diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index dacfef278e2..fb21e1c2e03 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -1255,7 +1255,7 @@ internal static bool BuildProject( InitializationException.Throw(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ProjectUpgradeNeededToVcxProj", projectFile), null); } - bool success = false; + bool success = true; ProjectCollection projectCollection = null; bool onlyLogCriticalEvents = false; @@ -1371,11 +1371,12 @@ internal static bool BuildProject( if (isPreprocess) { + success = false; + // TODO: Support /preprocess for solution files. https://github.com/dotnet/msbuild/issues/7697 if (isSolution) { Console.WriteLine(ResourceUtilities.GetResourceString("UnsupportedSwitchForSolutionFiles"), CommandLineSwitches.ParameterizedSwitch.Preprocess); - success = false; } else { @@ -1389,13 +1390,14 @@ internal static bool BuildProject( } } - if (isTargets) + if (isTargets && success) { + success = false; + // TODO: Support /targets for solution files. https://github.com/dotnet/msbuild/issues/7697 if (isSolution) { Console.WriteLine(ResourceUtilities.GetResourceString("UnsupportedSwitchForSolutionFiles"), CommandLineSwitches.ParameterizedSwitch.Targets); - success = false; } else { @@ -1405,6 +1407,7 @@ internal static bool BuildProject( if (!isPreprocess && !isTargets) { + success = false; BuildParameters parameters = new BuildParameters(projectCollection); // By default we log synchronously to the console for compatibility with previous versions,