app-config

Is there a way to load multiple app.configs in memory?

I have a windows service that loads multiple "handlers" written by different developers. The windows service exe has it's own app.config which I need. I'm trying to make it so that each developer can provide their own app.config along with their handler code. However, it seems an exe can only have one app.config. However, ASP.NET seems...

Code required to use foreach on my own custom appSettings

I've searched the site and haven't found exactly what I'm looking for. Close, but no cigar. Basically I want to have a config section like this: <configSections> <section name="PhoneNotificationsSection" type="Alerts.PhoneAlertConfigSection,Alerts,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null"/> </configSectio...

Nesting Levels in Custom Section Handlers in .NET Configuration Files

I know I can have 1 parent element and 1 child element in my own custom app.config section like so: <sectionGroup> <section> <element /> </section> </sectionGroup> My question is, can I have one or more levels of nesting more than this? Like so: <biggestSectionGroup> <biggerSectionGroup> <sectionGroup> <section> <elem...

How to Call my global value in app.config file

Hai, am using c# and wpf am having my value as a string, i need to call the string value in my app.config file for example in app.config file am having my connection string. the username may vary diff time. am having the user name as a globasl string. i need to call that string in my app.config connection string when application startu...

Cannot access app.config or settings.settings data

I have a .Net 3.5 application that needs to load a string from settings.settings or app.config. I made sure I have a reference to ConfigurationManager but a very simple call from form load value returns null. Here is the code: void LoadSettings() { // I expect to get from my app.config or settings.settings // Settings file s...

How do you get to you APP.CONFIG

I am working in VB.NET and I am familiar with working in the vb[design] view as well as regular vb. I am looking to view/edit my APP.CONFIG file how do I access this file? I am using Visual Studio 2008 ...

Find the name of the current config file

Is there a way to find the name (and path) of the current application's config file from inside a class library? E.g. in a web app this would be web.config, in a windows app or service this would be myapp.exe.config. ...

How do I create a Solution Wide Connection String

Hi. Does anyone know if it is possible to create a single connection string that will be accessible to all the projects in a solution (we have about 6). I can create a text file with this information, but we need design time support as well, and it is not practical to have a connection string in every App.Config and Web.config file i...

Trying to access App.config file for mail settings but fails to work.

Hello we have a Business Logic Layer which has an Email Services Class. In this class we have a method which will create an email(This part works and compiles fine). However when we try to access the app config file in order to test the method we get an error saying - Can't retrieve the app config mail settings and says all values are nu...

Re-cache App.Config

Hello every one. Is it posible to re-cache app.config? for example after changing some fields in app.config do not restart application. Thanks. ...

C# Windows Service Multiple Config Files

Quick Question Is it possible to have more than 1 config file in a windows service? Or is there some way I can merge them at run time? Scenario Currently I have two config files containing the below contents. After I build and install my Windows Service, I can't get my custom XML Parser class to read the content because it keeps point...

Change Address/Port of WSDL EndPointAddress at runtime?

So I currently have 2 WSDLs added as Service References in my solution. They look like this in my app.config file (I removed the "bindings" field, because it's uninteresting): <system.serviceModel> <client> <endpoint address="http://localhost:8080/query-service/jse" binding="basicHttpBinding" bindingConfiguration="QueryBinding" co...

Reading and writing to app.config file in C#

I have some of the values saved in app.config file, I want to create a WinForms application which shows all the AppSettings values in a Form. In the form user can change the settings values, after making changes the user can press the Save button and on this I want to save all the values back to the app.config file. Is there any way to...

App.config in Window service

I am in the process of designing a Windows Service, Where i have App.config. When the service is running i am not able to change the config values. But those values are not getting reflected. when it reades next time. Is it manadatory to restart service eveyr time we change config values? Do you have any suggestion how we can do this...

Deployment of encrypted app.config

Hi, Could you please help me? I've created a console .Net application and encrypted the app.config file with RSAProtectedConfigurationProvider. I've used an article http://www.codeproject.com/KB/dotnet/EncryptingTheAppConfig.aspx as an example for the Encryption. It works fine in an IDE on my XP desktop. Then I deployed my application to...

Creating a custom Configuration

I created a customer configuration class Reports. I then created another class called "ReportsCollection". When I try and do the "ConfigurationManager.GetSection()", it doesn't populate my collection variable. Can anyone see any mistakes in my code? Here is the collection class: public class ReportsCollection : ConfigurationElementColl...

c# Unit Test: Writing to Settings in unit test does not save values in user.config

I am running a c# unit test (VS 2008). Within the test I do write to the settings, which should result in saving the data to the user.config. Settings.Default.X = "History"; // X is string Settings.Default.Save(); But this simply does not create the file (I have crosschecked under "C:\Documents and Settings\HW\Local Settings\Applicati...

How to include simple collections in ConfigurationSection

Is there a way for me to include a simple array of strings, or List<string> on my custom subclass of ConfigurationSection? (Or an array or generic list of simple data objects, for that matter?) I'm becoming familiar with the new (and VERY verbose) ConfigurationSection, ConfigurationElement, and ConfigurationElementCollection classes, b...

Where to store: User connection information?

;) I am writing a .NET application wher ethe user connects to a given server. ALl information within the application is stored in the server. But I want / need to store the following information for the user: The server he connected to last The username he used to connect last (and no, no password, never ever). Any idea where to stor...

Access the path to the app.config programmatically

I am looking for a way to programmatically obtain the path to the app.config file from within a Windows Service executable. The build process changes App.config to program-name.exe.config and I could do something like: var configFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "program-name.exe.config"); However, I'm looking...