Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit ede15b6

Browse files
committed
Add MapProjectPlatformPath ext method to handler VS2017 bin/Release/net45 dir structure
1 parent aa082aa commit ede15b6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/ServiceStack.Text/PathUtils.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static string MapAbsolutePath(this string relativePath, string appendPart
1818
}
1919

2020
/// <summary>
21-
/// Maps the path of a file in the context of a VS project in a Consle App
21+
/// Maps the path of a file in the context of a VS project in a Console App
2222
/// </summary>
2323
/// <param name="relativePath">the relative path</param>
2424
/// <returns>the absolute path</returns>
@@ -33,6 +33,18 @@ public static string MapProjectPath(this string relativePath)
3333
return PclExport.Instance.MapAbsolutePath(relativePath, $"{sep}..{sep}..{sep}..");
3434
#endif
3535
}
36+
/// <summary>
37+
/// Maps the path of a file in the context of a VS 2017+ multi-platform project in a Console App
38+
/// </summary>
39+
/// <param name="relativePath">the relative path</param>
40+
/// <returns>the absolute path</returns>
41+
/// <remarks>Assumes static content is two directories above the /bin/ directory,
42+
/// eg. in a unit test scenario the assembly would be in /bin/Debug/net45</remarks>
43+
public static string MapProjectPlatformPath(this string relativePath)
44+
{
45+
var sep = PclExport.Instance.DirSep;
46+
return PclExport.Instance.MapAbsolutePath(relativePath, $"{sep}..{sep}..{sep}..");
47+
}
3648

3749
/// <summary>
3850
/// Maps the path of a file in the bin\ folder of a self-hosted scenario

0 commit comments

Comments
 (0)