86 questions
215
votes
18
answers
747k
views
AppSettings get value from .config file
I'm not able to access values in configuration file.
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
var clientsFilePath = config.AppSettings.Settings["...
106
votes
10
answers
288k
views
ConfigurationManager.AppSettings - How to modify and save?
It might sound too trival to ask and I do the same thing as suggested in articles, yet it doesn't work as expected. Hope someone can point me to the right direction.
I would like to save the ...
38
votes
4
answers
69k
views
ConfigurationManager.OpenExeConfiguration - loads the wrong file?
I have added multiple app.config (each with a differet name) files to a project, and set them to copy to the output directory on each build.
I try and access the contents of each file using this:
...
8
votes
4
answers
31k
views
Changing App.config at Runtime
I'm writing a test WinForms / C# / .NET 3.5 application for the system we're developing and we fell in the need to switch between .config files at runtime, but this is turning out to be a nightmare.
...
14
votes
3
answers
4k
views
Is there a way to get a System.Configuration.Configuration instance based on arbitrary xml?
I'm trying to unit test a custom ConfigurationSection I've written, and I'd like to load some arbitrary configuration XML into a System.Configuration.Configuration for each test (rather than put the ...
76
votes
14
answers
31k
views
Java configuration framework [closed]
I'm in the process of weeding out all hardcoded values in a Java library and was wondering what framework would be the best (in terms of zero- or close-to-zero configuration) to handle run-time ...
57
votes
9
answers
91k
views
System.Configuration.ConfigurationManager not available?
In a VS2005 C# project I have added a reference to System.configuration.
In the object browser, I can see the System.Configuration.ConfigurationManager.
In Intellisense System.Configuration only has ...
13
votes
3
answers
35k
views
Why my changes of AppSettings in App.config is not taken into account in run-time? (Console Application)
I have a console application which has its own App.config.
I need to change some values in section time to time.
My problem is, when I execute the exe within the bin/debug folder it gets the ...
77
votes
3
answers
35k
views
Does ConfigurationManager.AppSettings[Key] read from the web.config file each time?
I'm wondering how the ConfigurationManager.AppSettings[Key] works.
Does it read from the physical file each time I need a key? If so, should I be reading all the app settings of my web.config in a ...
23
votes
4
answers
43k
views
ConfigurationManager return null instead of string values
I am trying to retrieve values from my App.config file which is stored in my working directory, however when I run the program it returns null. I am very confused why this is so, and have looked over ...
12
votes
1
answer
26k
views
How to read values from multiple Configuration file in c# within a single project?
Here in my project I have two application configuration files called app.config and accessLevel.config. Now using the OpenExeConfiguration I was able to access the app.config.exe file but not the ...
10
votes
1
answer
7k
views
Open other program's configuration files
I have a program A, it also have an app.config file where I have added some keys like server address, username and password for connecting to a server. It is a console application. Now I want to make ...
8
votes
2
answers
5k
views
Can someone provide a quick App.config/Web.config tutorial?
I've used these two configuration files many times before, but I've never taken the time to fully understand how they really work. As most people do, I understand the basics in how to call ...
35
votes
8
answers
92k
views
Where is ConfigurationManager's namespace?
I've got a reference to System.Configuration - and ConfigurationSettings is found no problem - but the type or namespace 'ConfigurationManager' could not be found!?
I've read around - and it looks ...
17
votes
2
answers
27k
views
Visual Studio: Configuration Manager missing
I'm using Microsoft Visual Studio Team System 2008 Team Suite.
The "Configuration Manager" menu item is missing for me. I've assigned a keyboard shortcut to the Configuration Manager, but it doesn't ...
13
votes
1
answer
4k
views
dll.config not copied to temporary asp.net files folder
I have an Web.Api application that uses functions from a different assembly. For this assembly I have created a .config file where I store some strings.
I am using the following code which should ...
12
votes
2
answers
14k
views
Differences in behavior between System.Web.Configuration.WebConfigurationManager and System.Configuration.ConfigurationManager
I had some trouble on a test server with an ASP.NET website. I goofed, and had the home
directory of the Default Web Site pointed to the wrong place. When I tried:
ConfigurationManager....
9
votes
2
answers
9k
views
Using configurationmanager to read from multiple web.config files
Background:
I have some data thats stored in the web.config files of about 100 web applications. This data is getting moved to a database gradually. The webpages will show the web.config data until ...
3
votes
1
answer
7k
views
Where is SQL Server Configuration Manager in SQL Server 2016
Where is the SQL Server Configuration Manager in SQL Server 2016?
It is not under the menu group for SQL Server 2016.
(I have the Developer Edition installed)
1
vote
1
answer
4k
views
Implementing custom configuration section handler
gleanings from a variety of sources (including stackOverlflow), however when I come to use it, I get the following error message
"The Configuration property 'deviceconfig' may not be derived from ...
70
votes
4
answers
101k
views
Error: The name 'ConfigurationManager' does not exist in the current context
I have included the following statement in my Visual C# Console Application (Visual Studio 2005 .NET 2.0 Framework)
using System.Configuration;
and I am using the following statement in my ...
20
votes
5
answers
11k
views
Merging custom configuration sections at runtime in .NET
My question is about working with standard .NET configuration objects and custom configuration elements as well, (which one can define by extending the System.Configuration.ConfigurationSection class)....
11
votes
4
answers
10k
views
How to open a SectionGroup in an ASP.NET web application?
I have a small ASP.NET web application hosted in an integration test (executing within NUnit). My product code can usually find configuration data from the web.config or app.config file, but for some ...
9
votes
4
answers
8k
views
Change in AppSettings needs restart my Application how can I avoid?
I'm using C# .NET 2.0 Windows Application.
and I'm using app.config for my Application Settings.
but change in AppSettings doesn't reflected runtime, it Needs Application to be restarted.
How can I ...
8
votes
4
answers
27k
views
Getting error "The name 'Configuration' does not exist in the current context"
I am using Visual Studio 2013 with .NET Framework 4.5.
I have included the System.Configuration as a reference in the project.
I have also included a using statement in the class as such:
using ...