How to get a Type by string without specifying the assembly name, if it's among loaded asms
Okay, it's been forever since I had to do this in C#, but I need to get a Type by name without having to specify the assembly name, if it is among the currently loaded assemblies for the app domain. What's the best way to do this. Basically I want it to do what Type.GetType() does but a bit more permissive in that it searches all loaded assemblies instead of just the calling assembly when it comes to nonqualified names
2 Replies
Iterate AppDomain.GetAssemblies and try and retrieve your desired type from each one
Thanks, that's what I was going to do. I just didn't want to go off half cocked if there was a better way. 🙂