In .Net, given a type name, is there a method that tells me in which assembly (instance of System.Reflection.Assembly) that type is defined?
I assume that my project
I've adapted the accepted answer for my own purposes (returning the assembly object instead of the assembly name), and refactored the code for VB.NET and LINQ:
Public Function GetAssemblyForType(typeName As String) As Assembly
Return AppDomain.CurrentDomain.GetAssemblies.FirstOrDefault(Function(a) a.GetType(typeName, False, True) IsNot Nothing)
End Function
I'm just sharing it here if anyone else would like a LINQy solution to the accepted answer.