guys i tried this one:
current: \netcoreapp2.1\ResultPath
target : \netcoreapp2.1\ReportPath\report1
AssemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Uri currentPath = new Uri(AssemblyDirectory + "//ResultPath");
Uri targetPath = new Uri(reportsSubDir);
Uri relPath = currentPath.MakeRelativeUri(targetPath);
In result i'm getting
relPath.OriginalString = ReportPath/report1
Why is not ../ReportPath/report1 ?
And now for example:
if i have
current: \netcoreapp2.1\ResultPath\Test
target : \netcoreapp2.1\ReportPath\report1
I'm getting correct result in this way
relPath.OriginalString = ../../ReportPath/report10
Could anyone explain me why in first step i'm getting bad Relative Path, but in second good
and any idea how can i fix it, if i want to use first and second examples in my way ?