<p>I was looking for something like Server.MapPath in the ASP.NET realm to convert the output of Assembly.GetExecutingAssembly().CodeBase into a file path with drive letter.</p>

<p>The following code works for the test cases I've tried:</p>

<pre>
private static string ConvertUriToPath(string fileName)
{
    fileName = fileName.Replace("file:///", "");
    fileName = fileName.Replace("/", "\\");
    return fileName;
}
</pre>

<p>It seems like there should be something in the .NET Framework that would be much better--I just haven't been able to find it.</p>

Can you just use
```
Assembly.Location
```
?