I have an app.config file inside my TestProject, but when I try to read it using ConfigurationManager it reads from somewhere else and it's none of my app.config's. How to correct this?
Current config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="Production" connectionString="Server=127.0...
When developing a .NET Windows Forms Application we have the choice between those App.config tags to store our configuration values. Which one is better?
<configuration>
<!-- Choice 1 -->
<appSettings>
<add key="RequestTimeoutInMilliseconds" value="10000"/>
</appSettings>
<!-- Choice 2 -->
<configSections>
<sectionGr...
I have a solution in Visual Studio 2008 which contains multiple C# projects. Each project has it's own config file (App.config and Settings.settings). This makes sense architecturally as each module is autonomous and is used in a number of different solutions.
My problem is that when I compile the solution only the config file for the s...
How can one specify the connection string in a config file of a class library and later modify this when used in a ASP.NET Web Application?
The Class library is a data access layer that has a Dataset connecting to a database based on a connection string specified in a config file (Settings.settings/app.config).
This class library is us...
We all know that modifying a .NET web application's web.config file restarts the app and makes it read the updated configuration. How do you do that with a console or WinForms app? Thanks :)
...
For my project I have settings that I added through the Settings in the project properties.
I quickly discovered that editing the app.config file directly seems to no really update the settings value. Seems I have to view the project properties when I make a change and then recompile.
I'm wondering ... what is the best
and easies...
I have standard logging, nhibernate, etc configuration blocks in my app.config and I'd like to extract them into a common xml file that can be included as a reference by all of my applications' app.config files.
Is this possible?
...
Hi all,
I have a specific requirement to remove all client WCF configuration (<system.serviceModel>) out of the main app.config file, and into a separate XML file. The behaviour I would like to see is similar to that available in the appSettings section using the File="" directive. In fact, I'd ideally like to be able to specify a s...
Following my previous question, now I have 2 projects: one Console Project and a Library Project. They also have their respective unit test projects. When I run a test for the console project that uses a method from the library project and the library project needs an app.config setting, that setting must be in the console test project's...
I'm currently trying to run MSTest.exe from NCover, but I believe the question could apply generally to running MSTest.exe from the command line.
If I have the "/noisolation" argument, then MSTest.exe appears to find and use the app.config as expected. Without it, NCover doesn't capture any coverage information. From my research so fa...
Update: this question, including the title, was rephrased, see history for details
I know that the following App.config includes a external file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings configSource="appSettings.config"/>
<system.net>
<connectionManagement>
<add address="*" maxconnection="50...
Hi All,
I have a thought about this but could not come with a good solution.
I have a windows application. I use enterprise library (3.1) Data Access Application Block. Now I use the DataProtectionConfigurationProvider to encrypt the connection strings.
This application has to be deployed across multiple machines. I don't want the end...
I have a need to connect to a WCF service I wrote without having to deploy an app.config for the client application I'm writing. However, I've been having a very difficult time trying to figure out how to set up things from the client side in code. This is as far as I've gotten... does anyone have any ideas what I need to do to get this ...
I'm in the process of moving SQL server to a separate machine. Currently we are running our web server and sql server on the same box. So we have a production server with IIS and SQLServer and then a separate development server that mirrors this setup.
When it comes to our asp.net control's app.config and web site's web.config, this h...
I have 2 projects each one with its own unit test project, and one app.config for each project+test project pair. The tests do not fail if I run only one each time. But if use "Run all tests in solution" all tests will use just one of the app.config's, and it will be the wrong one for all tests in one of these test projects.
How do I ru...
I'm using the application-scoped settings to store settings that cannot change at run-time. I'm using the user-scoped settings to let individual users configure their preferences. But how should I store/control settings that are modifiable at run-time by an admin-level user that are application wide (i.e., they impact all of the PC's u...
Is there any way to make all the applications on a server use SQL Server as the session manager?
The reason is that we have a server with hundreds of applications and we want to start load balancing the server but it will be a big hassle to configure each individual application to use SQL Server as the session manager. It will also p...
I have a C# class library and a startup project (a console app). The class library includes a service reference to a web service. When I try to run the project, I get an InvalidOperationException because the startup project isn't reading the class library's app.config, and it's ignoring the service reference. To get it working, I'm force...
Is there any way that I could specify at runtime the configuration file I would like to use (other than App.config)? For example I would like to read a first argument from a command line that will be a path to the application's config and I would like my application to refer to it when I use ConfigurationManager.AppSettings (It's probabl...
I have a dll that I want to read from a manually specified app.config file (the dll is an .net extension to a native com dll that is a Microsoft Management Console snap in, so there is no mmc.exe.config). I have been able to open the config file, read the relevant group and section to get the setting that I want. Like this:
ExeConfig...