<p>What is the best way to get the application name (i.e MyApplication.exe) of the executing assembly from a referenced class library in C#?</p>

<p>I need to open the application's app.config to retrieve some appSettings variables for the referenced DLL.</p>

To get the answer to the question title:
```
```
// Full-name, e.g. MyApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
string exeAssembly = Assembly.GetEntryAssembly().FullName;

// or just the "assembly name" part (e.g. "MyApplication")
string exeAssemblyName = Assembly.GetEntryAssembly().GetName().Name;
```
```
As mentioned by @Ben, since you mention wanting to get the configuration information, use the
```
ConfigurationManager
```
class.