app-config

creating elements in app.config via code

Hi, I have the following section in my app.config <mySettings> <addins> <addin fullname="aaaaa" path="ddddd" version="ccccc" enabled="true" deleteonload="false" /> </addins> </mySettings> And im accessing it using a class that ...

Encrypting config files for deployment .NET

Hi, I have a windows service that reads from app.config I want some settings to be encrypted, however, I don't want to use the ProtectedConfigurationProvider classes provided in .NET because they encrypt files based on the machine they are running on using DPAPI. What I wanted was a way for our administrator to deploy the config file ...

Encrypting config files for deployment

Hi, I have a windows service that reads from app.config. I want some settings to be encrypted, however, I don't want to use the ProtectedConfigurationProvider classes provided in .NET because they encrypt files based on the machine they are running on using DPAPI. What I wanted was a way for our administrator to deploy the config file...

Secure, portable encrypted config values -- possible?

I'm just curious if anyone has any great ideas on this. We have a lot of C# windows services. Each app is installed on multiple machines (anywhere from 2-80, depending on the app.) Due to the security setup of the network, we cannot (consistently) use Windows authentication to the SQL servers, so our connection strings and credentia...

Why are .NET app.config load rules different for win2k3?

...and are there any other caveat for other platforms? I create an app.config for a win forms project, for example Application.exe. By default I expect that at runtime my application is going to look for a file called Application.exe.config. But there seem to be exceptions to this, for example in a Windows Server 2003 environment an a...

Custom Configuration, ConfigurationElements, and ConfigurationProperties

I've been scouring the net for the last 3 days, and can't find any reference to this question. I've created a custom configuration class to be used with my app.config. Everything works fine. The problem comes in when a configuration property (of a configuration element) is not required, and is not defined in the app.config. It seems t...

How much is to much for an application regarding keys in a config file?

I was looking at one of our legacy applications (ASP.NET 1.1/2.0 Web App) and had a tool to do a count of all key/value pairs. It seems that across 11 config files for the legacy application (app, web, data, and a bunch of custom config files) I found 1172 keys. I assume that some keys are no longer used and I wanted to convince the mana...

App.config and ConfigurationManager

Hi, If I call the OpenMappedExeConfiguration() method and specify a config file (filemap) as a parameter, does this mean that the ConfigurationManager will use the newly specified config file from that point onwards and ignore app.config? I know that ConfigurationManager looks for app.config by default, but because the OpenMappedExeCon...

IIS Config file in virtual directory

I have multiple websites that all have the same code, but different app settings. I want to place my app settings in a separate configuration file that is located in a virtual directory. This will allow me to have a single copy of all of the code shared across all of the sites with a different virtual directory for each site. Unfortuna...

C# Dll config file

Hi Im trying to add a app.config file to my dll, but all attempts have failed. According to MusicGenesis in 'Putting configuration information in a DLL' this should not be a problem. So obviously im doing something wrong... The following code should return my connectionstring from my dll : return ConfigurationManager.AppSettings["Co...

C# app.config format issue

Hello everyone, If the app.config format is wrong, for example, not a correct format XML file, application will fail from loading. Are there any ways to let me know such issue -- for example, receiving some events (so that I could write file log and event log to record this issue) if app.config loads error because of a mal-formatted XML...

Variables within app.config/web.config

I was wondering if it is possible to do something like this in the app.config or web.config: <appSettings> <add key="MyBaseDir" value="C:\MyBase" /> <add key="Dir1" value="[MyBaseDir]\Dir1"/> <add key="Dir2" value="[MyBaseDir]\Dir2"/> </appSettings> I then want to access Dir2 in my code by simply saying: ConfigurationManager.AppS...

Get values from the web.config section in an app.config file?

I'm trying to unit test values that will eventually wind up in a web.config file. In my test project, I created an app.config file with a web.config section to hold the settings. In a normal situation, I would call System.Configuration.ConfigurationSettings.AppSettings, but in this case, that doesn't work. I saw this question, which is v...

Why do Settings.settings files dump all their values into the app.config?

Why do Settings.settings files dump all their values into the app.config? Its not that much of a big problem, however, my application is getting larger and I think grouping them into separate files would help me organise things better. I was thinking of just creating multiple settings files, which is fine, but app.config is blowing up m...

Programatically adding sections to the configuration read from app.config

I am working on a component/assembly that is to be distributed to other developers and included in their systems. In order to minimize the work they have to do, all configuration is done in a seperate file (my.config). My current problem is that a library I am using requires configuration to be added to the app.config file of the appli...

Assembly's App.Config is being ignored; Machine.config being read instead.

In running my VS2008 unit integration tests against my DAL, I have found that the assembly is reading machine.config instead of the assembly's app.config. Here's the rundown on the call stack: Unit Test Project has method calling into a DataLayer Project MyDataLayer class inherits from a base class. Method is called GetStuff() Base c...

How do I configure my settings file to work with unit tests?

I have a library I'm writing unit tests for. The library is used by two applications: one a Windows service, the other a command-line application that does some registry read-writes. Each has a slightly different App.config file that is loaded from the library at start-up. For example: public RetentionService() { Setting...

If app.config for a DLL should be in the "main config"… what do we do with WCF References in DLLs?

Ok, this is rather simple, but from what I've seen… you can only use some sort of Windows Workflow to include another config into another (which I refuse to do). Here's the deal: MAINAPP.EXE References an hypothetical LIBRARY.DLL. MAINAPP.EXE has its own MAINAPP.EXE.config. If you add "config values" to LIBRARY.DLL (thereby creating ...

app.config weirdness

I've got a strange thing happening with my app.config file. My ConnectionStrings section contains this: <connectionStrings> <add name="Connection" connectionString="Data Source=TheServer; Initial Catalog=TheDatabase;IntegratedSecurity=SSPI" providerName="System.Data.SqlClient"/> </connectionStrings> However, when I query the ...

app.config encryption

I am devoloping an windows application in dot net.It's config file includes sensitive data such as sql pass..So When deploying application i want to give it as encrypted. I googled arund and found one that Rsiprovider to encrypt the fields. But encryption is machine specific and needs deploying config file in clear mode and after first r...