Hi!
I am having a problem with Uri constructor. Results differ on whether base path ends with slash or not.
var baseWithSlash = new Uri(@"c:\Temp\"); \\ "StackOverflow colorer workaround :)
var baseNoSlash = new Uri(@"c:\Temp");
var relative = "MyApp";
var pathWithSlash = new Uri(baseWithSlash, relative); // file:///c:/Temp/MyApp
var pathNoSlash = new Uri(baseNoSlash, relative); // file:///c:/MyApp
The first result is the one I expect even if there's no slash in base path.
My main problem is that base path comes from user input.
What's the best way to achieve correct result even if user specifies path without trailing slash?