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.
The following code works for the test cases I've tried:
private static string ConvertUriToPath(string fileName)
{
fileName = fileName.Replace("file:///", "");
fileName = fileName.Replace("/", "\\");
return fileName;
}
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.