Is there any way to get the assembly that contains a class with name TestClass
?
I just know the class name, so I can\'t create an instance of that. And
Assembly asm = typeof(TestClass).Assembly;
will get you the assembly as long as it is referenced. Otherwise, you would have to use a fully qualified name:
Assembly asm = null;
Type type = Type.GetType("TestNamespace.TestClass, ConsoleApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
if (type != null)
{
asm = type.Assembly;
}