title: Combining two relative Uris
body: <p>I need to combine two relative Uris, e.g. <code>../mypath/</code> and <code>myimage.png</code> to create <code>../mypath/myimage.png</code>. They are not paths to files on disk so <code>Path.Combine</code> is not appropriate (they are relative paths to resources for a web page). <code>new Uri</code> throws an <code>ArgumentOutOfRangeException</code> because the base uri is relative (not absolute).</p>
  
  <p>Do I have any options other than checking for a trailing slash and then combining the paths myself?</p>
  
  <p>EDIT:</p>
  
  <p>Here is a test case that demonstrates that Path.Combine will not work for the case when the first url does not already contain a trailing slash:</p>
  
  <pre><code>// The first case fails with result "../testpath\resource.png"
  [TestCase("../testpath", "resource.png", "../testpath/resource.png")] 
  [TestCase("../testpath/", "resource.png", "../testpath/resource.png")]
  public void TestPathCombine(string path, string resourceName, string expectedResult) {
      string result = Path.Combine(path, resourceName);
      Assert.AreEqual(expectedResult, result);
  }
  </code></pre>