public static string GetLocalPath(System.Reflection.AssemblyName assemblyName) {
Contract.Requires(assemblyName != null);
var loc = assemblyName.CodeBase;
if (loc == null) loc = "";
if (loc.StartsWith("file://", StringComparison.OrdinalIgnoreCase)) {
Uri u = new Uri(loc, UriKind.Absolute);
loc = u.LocalPath;
}
return loc;
}