Get the name of a application using an class library from within the class library

  • Thread starter Thread starter daftpunknl
  • Start date Start date
D

daftpunknl

Guest
I`m making a class library that takes care of sqlconnections for an application and ff the a query fail i get an email with the query and sql error message.

The class library is used by several applications. I want to include the name of the applicate in the email when an query fails.

So my question is how can I access information about an application that uses an class library from within the class library?

Also: am i correct if i say a class library is (exactly) the same as an assembly?
 
Class libraries are assemblies, yeah.

Code:
System.Reflection.Assembly.GetCallingAssembly().GetName().Name

Should give you roughly what you need.
 
Back
Top