title: Base Uri without a trailing slash
body: <p>If I create a <code>Uri</code> using the <code>UriBuilder</code> like this:</p>
  
  <pre><code>var rootUrl = new UriBuilder("http", "example.com", 50000).Uri;
  </code></pre>
  
  <p>then the <code>AbsoluteUri</code> of <code>rootUrl</code> always contain a trailing slash like this:</p>
  
  <pre><code>http://example.com:50000/
  </code></pre>
  
  <p>What I would like, is to create a <code>Uri</code> object without the trailing slash, but it seems impossible.</p>
  
  <p>My workaround is to store it as a string instead, and do something ugly like this:</p>
  
  <pre><code>var rootUrl = new UriBuilder("http", "example.com", 50000).Uri.ToString().TrimEnd('/');
  </code></pre>
  
  <p>I have heard people say that without the trailing slash, the Uri is invalid. I don't think that is true. I have looked through RFC 3986, and in section 3.2.2 it says:</p>
  
  <blockquote>
    <p>If a URI contains an authority component, then the path component
       must either be empty or begin with a slash ("/") character.</p>
  </blockquote>
  
  <p>It doesn't say that the trailing slash has to be there.</p>