Skip to content

Commit 3d4e91c

Browse files
authored
Merge pull request #3542 from dotnet/rc2-askmode-BaseIntermediateOutputPath
Ask-Mode: [release/5.0-rc2] Custom intermediate output paths shouldn't break markup compilation
2 parents ab840c4 + 8733ef2 commit 3d4e91c

File tree

3 files changed

+389
-13
lines changed

3 files changed

+389
-13
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,19 +1575,11 @@ private string ParentFolderPrefix
15751575
{
15761576
get
15771577
{
1578-
string parentFolderPrefix = string.Empty;
1579-
if (TargetPath.StartsWith(SourceFileInfo.SourcePath, StringComparison.OrdinalIgnoreCase))
1580-
{
1581-
string relPath = TargetPath.Substring(SourceFileInfo.SourcePath.Length);
1582-
relPath += SourceFileInfo.RelativeSourceFilePath;
1583-
string[] dirs = relPath.Split(new Char[] { Path.DirectorySeparatorChar });
1584-
for (int i = 1; i < dirs.Length; i++)
1585-
{
1586-
parentFolderPrefix += PARENTFOLDER;
1587-
}
1588-
}
1589-
1590-
return parentFolderPrefix;
1578+
#if NETFX
1579+
return PathInternal.GetRelativePath(TargetPath, SourceFileInfo.SourcePath, StringComparison.OrdinalIgnoreCase);
1580+
#else
1581+
return Path.GetRelativePath(TargetPath, SourceFileInfo.SourcePath);
1582+
#endif
15911583
}
15921584
}
15931585

0 commit comments

Comments
 (0)