app-config

Custom app.config section with a simple list of "add" elements

How do I create a custom app.config section that is just a simple list of add elements? I have found a few examples (e.g. http://stackoverflow.com/questions/1316058) for custom sections that look like this: <RegisterCompanies> <Companies> <Company name="Tata Motors" code="Tata"/> <Company name="Honda Motors" code="Honda"/> ...

How to get common library to read App.config of current executable

I have a common library and two executables. Each executable refers to the common library for some functionality. I would like the common library to read from the app.config of the exe which is currently running. Is there specific API calls to do this? ...

Is it possible to protect a single element in the appSettings section instead of the entire section?

I would like to protect one key/value pair in my appSettings but not the others using something like I've previously done with the ProtectSection method as seen below. var configurationSection = config.GetSection("appSettings"); configurationSection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider"); Ideally I ...

Bind any version of MySql.Data using the app.config

How do I bind any version or a range of versions of an assembly by using the app.config? I'm currently binding the MySql.Data assembly like this: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" applies-to="v2.0.50727"> <qualifyAssembly partialName="MySql.Data" fullName="MySql.Data, Ve...

app.config files of referenced dlls

I have a Web Project (VS 2008) that references a bunch of DLLs. The DLLs are built separately, so the project references binaries and not DLL projects. Some of the DLLs have their own app.config, which I want to be copied autmatically to the web project's output directory. Is there any suitable generic way to achieve this? ...

How to make ConfiguratioManager read a config file other than app.config?

Hi, I need to parse a config file that is situated in another project. I know that ConfigurationManager reads the app.config file by default (right?) how to make it read that particular config file? Thank you ...

How to load the App.config file?

Hi, I'm parsing the App.config file of a project. This config file has been loaded from a caller project. Inside the called project, I have something like: XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("app.config"); // Some parsing... Unfortunately the app.config file is not correctly located. Apparently the Load meth...

How to parse app.config using ConfigurationManager?

I was using a certain method for parsing my app.config file. Then I was told that using ConfigurationManager is better and simpler. But the thing is I don't know how to do it with ConfigurationManager. My original code looked like this: XmlNode xmlProvidersNode; XmlNodeList xmlProvidersList; XmlNodeList xmlTaskFactoriesList;...

One config file for multiple environments

I'm currently working with systems that has quite a lot of configuration settings that are environment specific (Dev, UAT, Production). Does anyone have any suggestions for minimizing the changes needed to the config file when moving between environments as well as minimizing the duplication of data in the config file? It's mostly Appli...

I need an app.config file to be used by an assembly at assembly initialization

How do I ensure that an app.config file gets read on assembly initialization, for .Net 3.5-4 ? It's a class library assembly. VS2008 provides a menu to add an app.config file, but it's ignored so far. I need to use the app.config to provide information for logging from the assembly. Thanks in advance! ...

Winforms connection strings from App.config

I have a Winforms app that I am developing in C# that will serve as a frontend for a SQL Server 2005 database. I rolled the executable out to a test machine and ran it. It worked perfectly fine on the test machine up until the last round of changes that I made. However, now on the test machine, it throws the following exception immediate...

How to register a namespace in app.config

How can i register a namespace in app.config so that it will become globally accessible. ...

Is it safe to change the 'Security.salt' line to a more lengthy string {64 hex key}

Hi everyone, I have changed the Configure::write('Security.salt', '############'); value in the file config/core.php file to a '256-bit hex key'. Is it safe or a good practice to change these lines for every different installation of cakephp application or shall I revert back to the original ? I also changed the Configure::write...

How do you store a WPF control value as a Property Setting in app.config?

We have a WPF windows application that contains a stackpanel control, that I want to be visible only for testing, but not when it is in production. We'd like to store the visibility value of that stackpanel in the application configuration file (app.config). What is the WPF way of achieving this? ...

Use ini/appconfig file or sql server file to store user config?

I know that the preference for INI or appconfig XML is their human readability. Let's say user preferences stored for my app are hierarchical and numbers about a thousand items and it would be really confusing for a user to edit an INI to change things anyway. I have always been using a combination of INI with appconfig. I am leaning ...

Changing the config file in a Visual Studio Package

Hello everybody. I'm building a Visual Studio Package and associated with it, I have an app.config file (which contains some information about connecting to a WCF service). As far as I can tell, this package is actually connecting to the devnev.exe.config configuration file (if I use AppDomain.CurrentDomain.SetupInformation.Configurati...

App.config path not correctly interpreted by ASP.NET Application

Hello everyone ! I'm working on a very old project (2000) in VB6 which was "modernized" and upgraded to VB.NET 3.5. I've centralized every old INI configuration file into one MainApp.config, which is referenced by the app.config of every component. There's an VB ASP.NET website in the solution, which uses DLL components, which are look...

How can I use a config-file in Expression Blend 4?

Hi, while trying to use the "InfoStrat"-Bing-Maps-Control in Expression Blend 4 for my Surface Application, I get the error message: "Mixed mode assembly is built against version v2.0.50527 of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information" I already found out that I need to write this c...

MissingMethodException when running application on different computer

I have a problem where I compiled my application on Visual Studio 2010 while targetting the .NET Framework 3.5, deployed it to a client server, only to find it gives me the following error: ************** Exception Text ************** System.MissingMethodException: Method not found: 'Void System.Xml.Xsl.XslCompiledTransform.Transform( ...

cannot access grailsApplication.config.images.location.toString())

Hi, I tried from a controller to use grailsApplication information to create some folder, however, what I got from the following line of code is "false" - my grails application runs well, though.... File(grailsApplication.config.images.location.toString()).mkdirs() could some one help, please? thanks. edit: thank you leebutts for...