---
title: "C# Reading Configuration settings"  
description: "C# Reading Configuration settings"  
author: "Anonymous User"  
published: 2014-01-31  
updated: 2014-01-31  
canonical: https://www.mindstick.com/forum/1932/c-sharp-reading-configuration-settings  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# C# Reading Configuration settings

I have a C# [class library](https://www.mindstick.com/forum/158577/what-is-the-significance-of-the-base-class-library-bcl-in-the-dot-net-framework) A which has some [configuration](https://www.mindstick.com/articles/13112/setting-up-the-perfect-configuration-for-your-work-computer) [settings](https://www.mindstick.com/blog/63563/steps-to-change-the-wireless-settings-using-linksys-cloud-account) in its App.config I [access](https://www.mindstick.com/articles/12994/how-foreigners-can-access-blocked-websites-in-china) them with

```
Method1(){string connectionString =
ConfigurationManager.AppSettings["ConnectionString"];}
```

But when I call [Method](https://www.mindstick.com/forum/166/webservice-method) 1() from my [ASP](https://www.mindstick.com/articles/751/introduction-to-asp-dot-net-mvc) [Web](https://www.mindstick.com/articles/12783/the-ultimate-bunch-of-free-web-design-resources) [project](https://www.mindstick.com/articles/105927/how-to-excel-at-managing-multiple-projects) B, it cannot find the configurations settings in the Class library A

Any idea what is happening here?

## Replies

### Reply by Pravesh Singh

Hi Ashish,\

I believe you can use OpenExeConfiguration to do this:

```
string exePath = "<full path and name of the app .exe file>";System.Configuration.Configuration otherConfig =     
ConfigurationManager.OpenExeConfiguration(exePath);
```

You could put the path of the other .exe in the web app's web.config (for instance, in the appSettings section), and read it from there, which would be better than hard-coding it here.

to view the appSettings in that config file:

AppSettingsSection otherAppSettings = otherConfig.AppSettings;


---

Original Source: https://www.mindstick.com/forum/1932/c-sharp-reading-configuration-settings

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
