@@ -18,42 +18,45 @@ public static string MapAbsolutePath(this string relativePath, string appendPart
18
18
}
19
19
20
20
/// <summary>
21
- /// Maps the path of a file in the context of a VS project
21
+ /// Maps the path of a file in the context of a VS project in a Consle App
22
22
/// </summary>
23
23
/// <param name="relativePath">the relative path</param>
24
24
/// <returns>the absolute path</returns>
25
25
/// <remarks>Assumes static content is two directories above the /bin/ directory,
26
26
/// eg. in a unit test scenario the assembly would be in /bin/Debug/.</remarks>
27
27
public static string MapProjectPath ( this string relativePath )
28
28
{
29
- var mapPath = MapAbsolutePath ( relativePath , string . Format ( "{0}..{0}.." , PclExport . Instance . DirSep ) ) ;
30
- return mapPath ;
29
+ var sep = PclExport . Instance . DirSep ;
30
+ #if ! NETSTANDARD1_1
31
+ return PclExport . Instance . MapAbsolutePath ( relativePath , $ "{ sep } ..{ sep } ..") ;
32
+ #else
33
+ return PclExport . Instance . MapAbsolutePath ( relativePath , $ "{ sep } ..{ sep } ..{ sep } ..") ;
34
+ #endif
31
35
}
32
36
33
37
/// <summary>
34
- /// Maps the path of a file in a self-hosted scenario
38
+ /// Maps the path of a file in the bin\ folder of a self-hosted scenario
35
39
/// </summary>
36
40
/// <param name="relativePath">the relative path</param>
37
41
/// <returns>the absolute path</returns>
38
42
/// <remarks>Assumes static content is copied to /bin/ folder with the assemblies</remarks>
39
43
public static string MapAbsolutePath ( this string relativePath )
40
44
{
41
- var mapPath = MapAbsolutePath ( relativePath , null ) ;
42
- return mapPath ;
45
+ return PclExport . Instance . MapAbsolutePath ( relativePath , null ) ;
43
46
}
44
47
45
48
/// <summary>
46
- /// Maps the path of a file in an Asp.Net hosted scenario
49
+ /// Maps the path of a file in an ASP.NET hosted scenario
47
50
/// </summary>
48
51
/// <param name="relativePath">the relative path</param>
49
52
/// <returns>the absolute path</returns>
50
53
/// <remarks>Assumes static content is in the parent folder of the /bin/ directory</remarks>
51
54
public static string MapHostAbsolutePath ( this string relativePath )
52
55
{
56
+ var sep = PclExport . Instance . DirSep ;
53
57
#if ! NETSTANDARD1_1
54
- return PclExport . Instance . MapAbsolutePath ( relativePath , $ "{ PclExport . Instance . DirSep } ..") ;
58
+ return PclExport . Instance . MapAbsolutePath ( relativePath , $ "{ sep } ..") ;
55
59
#else
56
- var sep = PclExport . Instance . DirSep ;
57
60
return PclExport . Instance . MapAbsolutePath ( relativePath , $ "{ sep } ..{ sep } ..{ sep } ..") ;
58
61
#endif
59
62
}
0 commit comments