简体   繁体   中英

How to get Assembly by its Assembly Name/ Default Namespace in C#

I'm aware that we have Assembly.GetAssembly(Type type) which lets you get the assembly by a type reference in the application. But is there a standard way to get an Assembly by its Assembly Name or Default Namespace?

For example: If I have a project named "Awesome.Namespace.WebApp" I would expect to get the assembly using something like this: Assembly.GetAssembly("Awesome.Namespace.WebApp") .

This is something I always come across when I don't want to get the assembly using a Type (or when I can't rely on that project having that respective Type)

有一种使用Assembly.Load方法的方法,该方法具有许多不同的重载 ,其中之一接受字符串,该字符串应为“程序集名称的长格式”。

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