|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Get Assembly of Calling Thread or Object?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 >Or, if using the thread is the wrong approach, is there a better/different Have you tried Assembly.GetCallingAssembly() ?>way to identify the assembly of the object that called my >Factory.CreateObject method? Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. That would be it. Good thing I wasn't looking for a poisonous snake. ;-)
Thanks! Show quote "Mattias Sjögren" wrote: > >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 > > -- > Mattias Sjögren [C# MVP] mattias @ mvps.org > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com > Please reply only to the newsgroup. > |
|||||||||||||||||||||||