Type.GetType(), GAC, strong names

  • Thread starter Thread starter lit
  • Start date Start date
L

lit

I want to use Type.GetType(typeName) for a class defined in an assembly
that will be in the GAC. I understand that I must provide strong name
information such as the KeyPair or versioninfo in the typeName string.

The Type that I am getting is statically referenced by other classes of
other assemblies that will be loaded into the appdomain. Therefore,
the strong name info should be dynamically available to me.

I want to be able to resolve that typeName without having to hard-code
the strong name info, or provide it via application configuration. Is
this possible?

I could also phrase the question this way: How can I determine the
strong name of an assembly that has been or will be loaded into the
Appdomain?

TIA,

Leo
 
I could also phrase the question this way: How can I determine the
strong name of an assembly that has been or will be loaded into the
Appdomain?

Well if the assembly is already loaded you can find it with it will be
in the AppDomain.GetAssemblies(). Once you found the Assembly instance
you're looking for you can simply call Assembly.GetType() and just
pass in the type name.

I don't see how you could reliably know which assemblies will be
loaded in the future.


Mattias
 
Back
Top