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"/>
...
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?
...
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 ...
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...
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?
...
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
...
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...
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;...
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...
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!
...
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 can i register a namespace in app.config so that it will become globally accessible.
...
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...
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?
...
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 ...
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...
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...
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...
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(
...
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...