app-config

How do you find what debug switches are available? Or given a switch find out what is being disabled?

In this question the answer was to flip on a switch that is picked up by the debugger disabling the extraneous header that was causing the problem. The Microsoft help implies these switched are user generated and does not list any switches. <configuration> <system.diagnostics> <switches> <add name="Remote.Disable" value="1"...

How can I store user-tweakable configuration in app.config?

I know it is a good idea to store configuration data in app.config (e.g. database connection strings) instead of hardcoing it, even if I am writing an application just for myself. But is there a way to update the configuration data stored in app.config from the program that is using it? ...

App.config connection string Protection error

I am running into an issue I had before; can't find my reference on how to solve it. Here is the issue. We encrypt the connection strings section in the app.config for our client application using code below: config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) If config.ConnectionStrings.Sect...

Sharing application preferences across multiple projects

We have a fairly large .NET solution with multiple executable projects (winforms and command line programs). Currently each of these projects has its own app.config that contains connection strings, mail server settings and the like. As you can imagine it's not that convenient to make a change in every app.config file whenever a particul...

App.config for dll

We have an "engine" that loads dlls dynamically (whatever is located in a certain directory) and calls Workflow classes from them by way of reflection. We now have some new Workflows that require access to a database, so I figured that I would put a config file in the dll directory. But for some reason my Workflows just don't see the c...

How can I share application configuration in a .net application?

I've got a relatively large .Net system that consists of a number of different applications. Rather than having lots of different app.config files, I would like to share a single configuration file between all the apps. I would also like to have one version when developing on my machine, one version for someone else developing on their ...

Is there a way to override ConfigurationManager.AppSettings?

I really want to be able to have a way to take an app that currently gets its settings using ConfigurationManager.AppSettings["mysettingkey"] to actually have those settings come from a centralized database instead of the app.config file. I can make a custom config section for handling this sort of thing, but I really don't want other d...

How can I set up a configuation file for .NET console applications?

Is it possible to use a ".net configuration" file for a .NET console application? I'm looking for an equivalent to web.config, but specifically for console applications... I can certainly roll my own, but If I can use .NET's built in configuration reader then I would like to do that...I really just need to store a connection string......

How do I store an XML value in my .NET App.Config file

I am trying to store an xml value in my app.config file. The app.config does not like this and I cannot use the <![CDATA[ construct to ignore the XML'ness of my value. Is there a way to do it? Value example:<FieldRef Name='LinkfileName' Nullable='True'/><FieldRef Name='Web' Nullable='True'/> ...

How to store key-value pairs in application settings at runtime?

How can dynamic Key-value pairs of objects be stored in app.config in using the application settings api, at runtime? I've been trying to get my head around, and I can't find any meaningful example or documentation. I seems that .Net dictionary classes can't be serialized in XML to store them in app.config Is the only way to do it by ...

How can I debug a VB6 project that has a .net interop project which uses an app.config file?

I have a .net interop project that uses an app.config file. When I am running the VB6 project that is using the interop control in Debug mode, the ConfigurationManager cannot find the app.config file. When I make the VB6 project into an exe and rename the app.config file to (VB6 binary name).exe.config, the ConfigurationManager can find ...

Render App.config/Web.config files via XSLT

Does anyone have an XSLT that will take the app.config and render it into a non-techie palatable format? The purpose being mainly informational, but with the nice side-effect of validating the XML (if it's been made invalid, it won't render) ...

HOWTO: specify in app.config to call a function before Main() is called?

I really want to put in some sort of section handler into App.config that will execute some code before the application actually starts executing at Main. Is there any way to do such a thing? ...

Saving XML-Data in UserSettings

Hi all, I'm trying to save some XML-Data in my UserSettings (Properties.Settings.Default.UserSettings) in a .NET Winforms Project. Is there a Possibility to do that or would it be better to save this Data in a seperated File? Thanks for your Answers! ...

How to load back a dynamically created settingsproperty next time

I created a way to dynamically add settingsproperty to a .net app.config file. It all works nic, but when I am launching my app the next time I can only see the properties that are created in the designer. How can I load back the properties runtime. My code for creating the settingsproperty looks the following: internal void CreatePro...

app.config configSections custom settings can not find schema information

Hi all, I am just learning about app.config in respect of creating custom sections. I have that part working, it compiles and gets the information out as required but I get warnings about it could not find the schema information. I have done a bit of googling and could not find a simple explanation of this situation. The approach (th...

How to use an app.config file when calling a C# dll from C++

How do I use an app.config file for the .Net part when calling a .Net dll from C++ and the data in the config-file must be read at the .Net runtime startup. If I use have a foo.dll.config that I call from ConfigurationManager.OpenExeConfiguration("foo.dll") I can access application settings. What I would like to do though is to change s...

Setup App.Config As Custom Action in Setup Project

I have a custom application with a simple app.config specifying SQL Server name and Database, I want to prompt the user on application install for application configuration items and then update the app.config file. I admit I'm totally new to setup projects and am looking for some guidance. Thank You Mark Koops ...

.net dynamically refresh app.config

How do I dynamically reload the app.config in a .net Windows application? I need to turn logging on and off dynamically and not just based upon the value at application start. ConfigurationManager.RefreshSection("appSettings") does not work and I've also tried explicitly opening the config file using OpenExeConfiguration but I always g...

Using Windows Role authentication in the App.config with WCF

I am using a WCF service and a net.tcp endpoint with serviceAuthentication's principal PermissionMode set to UseWindowsGroups. Currently in the implementation of the service i am using the PrincipalPermission attribute to set the role requirements for each method. [PrincipalPermission(SecurityAction.Demand, Role = "Administrat...