简体   繁体   中英

I have Microsoft assembly name. How to find out the Dll name in which this assembly exists

I have a Microsoft assembly name and class name (Microsoft.Crm.Asynchronous). How can I find out the name of Dll that this assembly resides.

I am instrumenting the performance of various dlls in App dynamics tool. I searched up and found ildasm.exe . But this is a disassembler of a DLL.

I want to know the dll. How can I know the name of the Microsoft Dll if I know one of the assembly name and class name in that dll?

thank you

The Assembly.CodeBase property will return the assembly's original location, even if it has been copied to a temporary location via shadow copying . You can use typeof(TypeName).Assembly to access the assembly. As a complete example:

var dll = typeof(Microsoft.Crm.Asynchronous).Assembly.CodeBase;

The CodeBase property returns a string in a URI format, so you may want this instead to translate it to a regular path:

var dll = new Uri( typeof(Microsoft.Crm.Asynchronous).Assembly.CodeBase ).LocalPath;

If shadow copying isn't a concern for you, you can use Assembly.Location which is already a regular path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM