views:

130

answers:

2

Hi folks,

I am trying to write a method for a Compact Framework 2.0 dll which will return the name of the parent application from which the dll is called but I am struggling to see how to do this.

Using reflection I am able to get the dll I have written etc - any ideas how to get the application name?

Thanks

Morris

+1  A: 

You can use

AppDomain.CurrentDomain.FriendlyName
Chris
A: 

And if you want the full path to the EXE:

Assembly.GetCallingAssembly().GetName().CodeBase
ctacke
Does it work if the exe is not calling directly the assembly, i.e. EXE -> DLL1 -> DLl2?
Juanma