From 5567239a9411aac769a34f2c65b80a523a577ad7 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 6 Oct 2022 11:59:31 -0700 Subject: Run wix.exe out of proc "wix build" will load assemblies to read metadata which can cause the assemblies to get locked in the process. Since MSBuild keeps build processes alive this can cause work done by in-proc MSBuild tasks (like the WixBuild) to get stuck. Moving the "wix build" out of proc avoids any of those issues. Moving out of proc also allows the WiX tasks to be AnyCPU which simplifies the wix.targets (although did need to add code to find the .NET Framework wix.exe). Fixes 6595 --- src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs') diff --git a/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs b/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs index 32680e5d..3271cc20 100644 --- a/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs +++ b/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs @@ -17,7 +17,7 @@ namespace WixToolsetTest.Sdk public static class MsbuildUtilities { - public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal", bool suppressValidation = true) + public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", string verbosityLevel = "normal", bool suppressValidation = true) { var allArgs = new List { @@ -30,11 +30,6 @@ namespace WixToolsetTest.Sdk $"-bl:{Path.ChangeExtension(projectPath, ".binlog")}" }; - if (outOfProc.HasValue) - { - allArgs.Add($"-p:RunWixToolsOutOfProc={outOfProc.Value}"); - } - if (arguments != null) { allArgs.AddRange(arguments); @@ -96,11 +91,9 @@ namespace WixToolsetTest.Sdk } } - public static IEnumerable GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem, bool? outOfProc = null) + public static IEnumerable GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem) { - var expectedOutOfProc = buildSystem == BuildSystem.DotNetCoreSdk || outOfProc.HasValue && outOfProc.Value; - var expectedToolExe = !expectedOutOfProc ? $"({toolName}.exe)" : - buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; + var expectedToolExe = buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; var expectedToolCommand = $"{expectedToolExe} {operation}"; return result.Output.Where(line => line.Contains(expectedToolCommand)); } -- cgit v1.2.3-55-g6feb