diff --git a/src/Tasks.UnitTests/OutputPathTests.cs b/src/Tasks.UnitTests/OutputPathTests.cs
index f2bc410bbbd..6b4da05750a 100644
--- a/src/Tasks.UnitTests/OutputPathTests.cs
+++ b/src/Tasks.UnitTests/OutputPathTests.cs
@@ -61,7 +61,7 @@ public void BothBaseOutputPathAndOutputPathWereNotSpecified()
project.Build(new MockLogger(_output)).ShouldBeFalse();
// Assert
- project.GetPropertyValue("BaseOutputPath").ShouldBe(baseOutputPath.WithTrailingSlash());
+ project.GetPropertyValue("BaseOutputPath").ShouldBe(baseOutputPath + '\\');
project.GetPropertyValue("BaseOutputPathWasSpecified").ShouldBe(string.Empty);
project.GetPropertyValue("_OutputPathWasMissing").ShouldBe("true");
}
diff --git a/src/Tasks/Microsoft.Common.CrossTargeting.targets b/src/Tasks/Microsoft.Common.CrossTargeting.targets
index c4bc9a95d34..f59b407d959 100644
--- a/src/Tasks/Microsoft.Common.CrossTargeting.targets
+++ b/src/Tasks/Microsoft.Common.CrossTargeting.targets
@@ -211,7 +211,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<_DirectoryBuildTargetsFile Condition="'$(_DirectoryBuildTargetsFile)' == ''">Directory.Build.targets
<_DirectoryBuildTargetsBasePath Condition="'$(_DirectoryBuildTargetsBasePath)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), '$(_DirectoryBuildTargetsFile)'))
- $([MSBuild]::NormalizePath('$(_DirectoryBuildTargetsBasePath)', '$(_DirectoryBuildTargetsFile)'))
+ $([System.IO.Path]::Combine('$(_DirectoryBuildTargetsBasePath)', '$(_DirectoryBuildTargetsFile)'))
diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets
index 9c9d0d5f025..4726db6c8b6 100644
--- a/src/Tasks/Microsoft.Common.CurrentVersion.targets
+++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets
@@ -150,15 +150,17 @@ Copyright (C) Microsoft Corporation. All rights reserved.
Debug
$(Configuration)
- $([MSBuild]::EnsureTrailingSlash($([MSBuild]::ValueOrDefault('$(BaseOutputPath)', 'bin'))))
- $([System.IO.Path]::Combine('$(BaseOutputPath)', '$(Configuration)'))
- $([System.IO.Path]::Combine('$(BaseOutputPath)', '$(PlatformName)', '$(Configuration)'))
- $([MSBuild]::EnsureTrailingSlash('$(OutputPath)'))
-
- $([MSBuild]::EnsureTrailingSlash($([MSBuild]::ValueOrDefault('$(BaseIntermediateOutputPath)', 'obj'))))
- $([System.IO.Path]::Combine('$(BaseIntermediateOutputPath)', '$(Configuration)'))
- $([System.IO.Path]::Combine('$(BaseIntermediateOutputPath)', '$(PlatformName)', '$(Configuration)'))
- $([MSBuild]::EnsureTrailingSlash('$(IntermediateOutputPath)'))
+ bin\
+ $(BaseOutputPath)\
+ $(BaseOutputPath)$(Configuration)\
+ $(BaseOutputPath)$(PlatformName)\$(Configuration)\
+ $(OutputPath)\
+
+ obj\
+ $(BaseIntermediateOutputPath)\
+ $(BaseIntermediateOutputPath)$(Configuration)\
+ $(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\
+ $(IntermediateOutputPath)\
@@ -222,14 +224,15 @@ Copyright (C) Microsoft Corporation. All rights reserved.
true
+ $(OutputPath)
- $([MSBuild]::EnsureTrailingSlash($([MSBuild]::ValueOrDefault('$(OutDir)', '$(OutputPath)'))))
+ $(OutDir)\
$(MSBuildProjectName)
- $([MSBuild]::EnsureTrailingSlash('$(OutDir)$(ProjectName)'))
+ $(OutDir)$(ProjectName)\
$(MSBuildProjectName)
$(RootNamespace)
@@ -315,7 +318,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
Condition intentionally omitted on this one, because it causes problems
when we pick up the value of an environment variable named TargetDir
-->
- $([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(OutDir)'))
+ $([MSBuild]::Escape($([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(OutDir)`))`))))
$(TargetDir)$(TargetFileName)
@@ -403,12 +406,12 @@ Copyright (C) Microsoft Corporation. All rights reserved.
$(IntermediateOutputPath)$(TargetName).pdb
- <_WinMDDebugSymbolsOutputPath>$(OutDir)$([System.IO.Path]::GetFileName('$(WinMDExpOutputPdb)'))
+ <_WinMDDebugSymbolsOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDExpOutputPdb)'))))
$(IntermediateOutputPath)$(TargetName).xml
- <_WinMDDocFileOutputPath>$(OutDir)$([System.IO.Path]::GetFileName('$(WinMDOutputDocumentationFile)'))
+ <_WinMDDocFileOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDOutputDocumentationFile)'))))
@@ -480,7 +483,8 @@ Copyright (C) Microsoft Corporation. All rights reserved.
- $([MSBuild]::EnsureTrailingSlash($([MSBuild]::ValueOrDefault('$(PublishDir)', '$(OutputPath)app.publish'))))
+ $(PublishDir)\
+ $(OutputPath)app.publish\
true
- $(IntermediateOutputPath)$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)
+ $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))
@@ -4622,7 +4626,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
-
+
diff --git a/src/Tasks/Microsoft.Common.props b/src/Tasks/Microsoft.Common.props
index eaa9725f75e..32f5f05ab9f 100644
--- a/src/Tasks/Microsoft.Common.props
+++ b/src/Tasks/Microsoft.Common.props
@@ -27,7 +27,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<_DirectoryBuildPropsFile Condition="'$(_DirectoryBuildPropsFile)' == ''">Directory.Build.props
<_DirectoryBuildPropsBasePath Condition="'$(_DirectoryBuildPropsBasePath)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), '$(_DirectoryBuildPropsFile)'))
- $([MSBuild]::NormalizePath('$(_DirectoryBuildPropsBasePath)', '$(_DirectoryBuildPropsFile)'))
+ $([System.IO.Path]::Combine('$(_DirectoryBuildPropsBasePath)', '$(_DirectoryBuildPropsFile)'))
@@ -44,16 +44,18 @@ Copyright (C) Microsoft Corporation. All rights reserved.
The declaration of $(BaseIntermediateOutputPath) had to be moved up from Microsoft.Common.CurrentVersion.targets
in order for the $(MSBuildProjectExtensionsPath) to use it as a default.
-->
- $([MSBuild]::EnsureTrailingSlash($([MSBuild]::ValueOrDefault('$(BaseIntermediateOutputPath)', 'obj'))))
+ obj\
+ $(BaseIntermediateOutputPath)\
<_InitialBaseIntermediateOutputPath>$(BaseIntermediateOutputPath)
- $([MSBuild]::EnsureTrailingSlash($([MSBuild]::ValueOrDefault('$(MSBuildProjectExtensionsPath)', '$(BaseIntermediateOutputPath)'))))
+ $(BaseIntermediateOutputPath)
- $([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(MSBuildProjectExtensionsPath)'))
+ $([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(MSBuildProjectExtensionsPath)'))
+ $(MSBuildProjectExtensionsPath)\
true
<_InitialMSBuildProjectExtensionsPath Condition=" '$(ImportProjectExtensionProps)' == 'true' ">$(MSBuildProjectExtensionsPath)
diff --git a/src/Tasks/Microsoft.Common.targets b/src/Tasks/Microsoft.Common.targets
index f14a2810499..753dad7cfaf 100644
--- a/src/Tasks/Microsoft.Common.targets
+++ b/src/Tasks/Microsoft.Common.targets
@@ -138,7 +138,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<_DirectoryBuildTargetsFile Condition="'$(_DirectoryBuildTargetsFile)' == ''">Directory.Build.targets
<_DirectoryBuildTargetsBasePath Condition="'$(_DirectoryBuildTargetsBasePath)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), '$(_DirectoryBuildTargetsFile)'))
- $([MSBuild]::NormalizePath('$(_DirectoryBuildTargetsBasePath)', '$(_DirectoryBuildTargetsFile)'))
+ $([System.IO.Path]::Combine('$(_DirectoryBuildTargetsBasePath)', '$(_DirectoryBuildTargetsFile)'))