diff --git a/src/Compilers/Core/MSBuildTask/ManagedCompiler.cs b/src/Compilers/Core/MSBuildTask/ManagedCompiler.cs index acc184011c60bd3ee8cec4d996a6630caf34b93c..834766dc60e72a82c2a2eedff03af142f2039e23 100644 --- a/src/Compilers/Core/MSBuildTask/ManagedCompiler.cs +++ b/src/Compilers/Core/MSBuildTask/ManagedCompiler.cs @@ -636,6 +636,7 @@ protected internal virtual void AddResponseFileCommands(CommandLineBuilderExtens commandLine.AppendWhenTrue("/nowin32manifest", _store, nameof(NoWin32Manifest)); commandLine.AppendPlusOrMinusSwitch("/optimize", _store, nameof(Optimize)); commandLine.AppendPlusOrMinusSwitch("/deterministic", _store, nameof(Deterministic)); + commandLine.AppendSwitchIfNotNull("/pathmap:", PathMap); commandLine.AppendSwitchIfNotNull("/out:", OutputAssembly); commandLine.AppendSwitchIfNotNull("/ruleset:", CodeAnalysisRuleSet); commandLine.AppendSwitchIfNotNull("/errorlog:", ErrorLog); diff --git a/src/Compilers/Core/MSBuildTaskTests/CscTests.cs b/src/Compilers/Core/MSBuildTaskTests/CscTests.cs index 584fb8a148028cb45f78fa881a62516d5f778387..7611a0a4e8fa30c76611bb1477c433e333844a91 100644 --- a/src/Compilers/Core/MSBuildTaskTests/CscTests.cs +++ b/src/Compilers/Core/MSBuildTaskTests/CscTests.cs @@ -33,7 +33,7 @@ public void PathMapOption() var csc = new Csc(); csc.Sources = MSBuildUtil.CreateTaskItems("test.cs"); csc.PathMap = "K1=V1,K2=V2"; - Assert.Equal("/pathmap:\"K1=V1,K2=V2\" /out:test.exe test.cs", csc.GenerateResponseFileContents()); + Assert.Equal("/pathmap:K1=V1,K2=V2 /out:test.exe test.cs", csc.GenerateResponseFileContents()); csc = new Csc(); csc.Sources = MSBuildUtil.CreateTaskItems("test.cs"); diff --git a/src/Compilers/Core/MSBuildTaskTests/VbcTests.cs b/src/Compilers/Core/MSBuildTaskTests/VbcTests.cs index c109920417c745be7de877e0d202343b72e6c4d0..0fc2bdcbe20c0a9e411835258236f5d8fbf5abea 100644 --- a/src/Compilers/Core/MSBuildTaskTests/VbcTests.cs +++ b/src/Compilers/Core/MSBuildTaskTests/VbcTests.cs @@ -30,7 +30,7 @@ public void PathMapOption() var vbc = new Vbc(); vbc.Sources = MSBuildUtil.CreateTaskItems("test.vb"); vbc.PathMap = "K1=V1,K2=V2"; - Assert.Equal("/optionstrict:custom /pathmap:\"K1=V1,K2=V2\" /out:test.exe test.vb", vbc.GenerateResponseFileContents()); + Assert.Equal("/optionstrict:custom /pathmap:K1=V1,K2=V2 /out:test.exe test.vb", vbc.GenerateResponseFileContents()); vbc = new Vbc(); vbc.Sources = MSBuildUtil.CreateTaskItems("test.vb");