Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
I am looking for a way to get the calling programs name form the called assembly...any ideas?
amazonpup
18y
1.6k
1
Reply
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.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Delegate throwing Null Exception
can not update my SQL server database from C# Application