typeof([TypeKnownToBeInTheDesiredAssembly]).Assembly.CodeBase
例如,找到系统.Xml.dll:
string codeBase = typeof(System.Xml.XmlDocument).Assembly.CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
Console.WriteLine(path);
[ref]
在我的系统上: