title: System.Uri fails to give correct AbsolutePath and LocalPath if the Path contains "#"
body: <p>I have C# code that is trying to get the <code>LocalPath</code> for a executing assembly using the following line of code:</p>
  
  <p><code>Uri uri = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;</code></p>
  
  <p>This piece of code performs fine for all the variety of paths.  It started to fail giving the right <code>AbsolutePath</code> and <code>Localpath</code> because the executing assembly path contained a # in it.</p>
  
  <p><code>Assembly.GetExecutingAssembly().CodeBase</code> gives <code>"C:\c#\ExcelAddin1.1.0\GSRExcelPlugin\bin\Debug\Common.dll"</code></p>
  
  <p>But new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath gives "C:\c" while it should have given "C:\c#\ExcelAddin1.1.0\GSRExcelPlugin\bin\Debug\".</p>
  
  <p>Is there something that I need to handle or is there something wrong the way Uri class is used?</p>
  
  <p>If this is a .net framework issue, how should I report this issue to Microsoft?</p>