Get Assembly of Calling Thread or Object?

G

Guest

Does anyone know how to get the assembly associated with a particular thread?

I'm creating a generic Factory class to create types based on config file
parameters. I would like to use the calling object's assembly if it isn't
specified in the config value. I know how to get the current executing
assembly, but I don't know how to find the assembly associated with the
calling thread, which will always be a seperate assembly.

Or, if using the thread is the wrong approach, is there a better/different
way to identify the assembly of the object that called my
Factory.CreateObject method?

Thanks in advance.

Troy
 
M

Mattias Sjögren

Or, if using the thread is the wrong approach, is there a better/different
way to identify the assembly of the object that called my
Factory.CreateObject method?

Have you tried Assembly.GetCallingAssembly() ?


Mattias
 

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