Skip to content

Commit

Permalink
.NET Core WPF Build error on custom BaseIntermediateOutputPath #1718 (#…
Browse files Browse the repository at this point in the history
…3120)

* Use more robust relative path calculation in markup code generation
  • Loading branch information
ryalanms authored Sep 17, 2020
1 parent cd95e7a commit 922458c
Show file tree
Hide file tree
Showing 3 changed files with 389 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1575,19 +1575,11 @@ private string ParentFolderPrefix
{
get
{
string parentFolderPrefix = string.Empty;
if (TargetPath.StartsWith(SourceFileInfo.SourcePath, StringComparison.OrdinalIgnoreCase))
{
string relPath = TargetPath.Substring(SourceFileInfo.SourcePath.Length);
relPath += SourceFileInfo.RelativeSourceFilePath;
string[] dirs = relPath.Split(new Char[] { Path.DirectorySeparatorChar });
for (int i = 1; i < dirs.Length; i++)
{
parentFolderPrefix += PARENTFOLDER;
}
}

return parentFolderPrefix;
#if NETFX
return PathInternal.GetRelativePath(TargetPath, SourceFileInfo.SourcePath, StringComparison.OrdinalIgnoreCase);
#else
return Path.GetRelativePath(TargetPath, SourceFileInfo.SourcePath);
#endif
}
}

Expand Down
Loading

0 comments on commit 922458c

Please sign in to comment.