I'm seeing some strange (to me anyway) behavior when using MakeRelativeUri on Mono (2.6.7). Take the following example:
var uri1 = new Uri("/somepath/someothersubpath/");
var uri2 = new Uri("/somepath/img/someimg.jpg");
var uri3 = uri1.MakeRelativeUri(uri2);
Console.WriteLine(uri3.OriginalString);
I'd expect this to output "../img/someimg.jpg"
, but I get "img/someimg.jpg"
A friend has confirmed using windows/visual studio that he gets my expected result if appending an extra slash to the beginning of the string (I've tried this as well, and to no avail).
I'm not sure if this is an issue with the Uri class in mono, or if my understanding of how the URI class should work is flawed, but any advice that can help me get to the expected output would be greatly appreciated.
Thanks,
Alex