I am looking for a way to get the calling programs name form the called assembly...any ideas?

Jun 13 2006 5:31 PM
I have an assembly that I am using to log errors and I am working on updating it from .Net 1.1 to 2.0. In 1.1 I could use the following code to get the calling programs name:

System.Diagnostics.StackFrame sf = new System.Diagnostics.StackTrace().GetFrame(2);
string programName = sf.GetMethod().ReflectedType.Module.Name;

This code would give me 'programName.dll'. Now when I call the assembly from a web app I get 'App_Web_randomString.dll'.

I need a way to get the meaningful name of the web application that called the assembly. It doesnt have to be 'programName.dll', I just need someway to identify what program called this assembly.

Any help would be appreciated.

Thanks.