Never trust GetEntryAssembly
One quick tip-
I was using Assembly.GetEntryAssembly().FullName in my logging infrastructure to get the name of the application assembly. It turns out that the call throws an exception when called in any appdomain other than the default - GetEntyAssembly returns null, and the .Fullname causes the exception. A better solution: Process.GetCurrentProcess().ProcessName. As an added bonus, the GetCurrentProcess also provides a list of loaded modules, each with oodles of properties.
Comments
- Anonymous
September 08, 2003
The comment has been removed - Anonymous
September 08, 2003
Thanks for the tip... We have all kinds of remoting requirements, but I'll check if we can use ExecuteAssembly instead of our current AppDomain.CreateInstanceAndUnwrap