Accessing fully qualified name of Assembly programmatically?

E

Erland

Hi all,

As per my understanding in order to load an assembly using
Assembly.Load() you have to provide fully qualified name of the
assembly you are trying to load e.g.

Assembly
asmb=Assembly.Load("System.Windows.Forms,Version=1.0.5000.0,Culture=neutral,PublicKeyToken=b77a5c561934e089");

In this case i will have to provide the whole big string in
Assembly.Load() as parameter. Is not there any class/method that would
give me the fully qualified name of the assembly im trying to load so
that i don't have to type the big string. I don't have problems with
typing big strings :). Im just wondering what if i don't the fully
qualified name in advance.

Some restless souls might think what i am trying to acheive here, well
i have used the Reflector tool and im in love with it. I am just trying
to write a program that would load all basic assemblies provided by
..net and then play with them to improve my .net skills in general and
reflection in particular.

So is there any work around ?
Please provide some feedback.
Thanks.
 
C

Chris Dunaway

Have you tried Assembly.LoadFile() and just pass in the filename?

You could also try calling GetType on an object and then access its
AssemblyQualifiedName property.

string s = MyForm.GetType().AssemblyQualifiedName
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top