configuration-files

Configuring a tabulator set to a string via Spring.NET

I'm trying to get Spring.Net to set a tab to a property (Separators) on my service class, however whatever I try to use e.g. "\u0009" or a real tabulator spring refuses to use a tab. The real tab is set as a space, the unicode is escaped, "\t" is escaped as well. <object name="s:SomeKindOfService" type="Services.SomeKindOfService, Assem...

Reading config file without Configuration section

Little embarrassed to ask, but since I never had to do it, here it goes. I have a config file that has connection strings for the app stored in this format. <connectionStrings> <clear /> <add name="MyConnectionStringName" connectionString="{here is a connection string}"/> </connectionStrings> I tried ConfigurationManager but i...

How to use .NET configuration files (app.config, settings.settings) to save and restore all application data?

Although there are a lot of posts about .net config files, I believe that my requirements do not allow for any of the solutions proposed (or I don't understand the process enough to make it work for me). The situation is that I have a Windows Forms application (could just as well be another app) which binds certain user input fields (e....

Is there a way to encrypt the configuration file of a Windows Forms application?

Is there a way to encrypt the configuration file of a Windows forms application? All I can find on google is stuff that is dependant on "aspnet_regiis.exe" but I want to do this for a desktop application? e.g. http://msdn.microsoft.com/en-us/library/ms998283.aspx ...

Couldn't locate driver named mysql in doctrine php....

My application was working perfectly on localhost. But when i uploaded the application on server i got an error. I made a test file to check databse connection, this is the error i am getting. Please hellp me how to fix this.. Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't locate driver named mys...

How to implement a sample log4net repository

How do I implement a custom LOG4NET parser for my XML file. My XML file contains: (1) extra attributes on the appender element (2) custom replacements on the elements of some of the appenders that need to be set at runtime. For example: <appender name=... type=... mode="something"> <some-property-of-appender>${MyValueForThisPropert...

Best Config File Format

I'm starting a new multi-language project completely without cruft. I have to choose a format for config files. These will be: Written by humans (developers, not end users) Read by machines Maintained by humans Worked with by text editors (not a tool) I have many different uses, like: List of modules to run Module execution order ...

Extending configuration for .Net 3.5 Applications

Due to a requirement in my current project, I have to build a configuration manager to handle configurations that merge local config info with database one. Custom configuration doesn't fit my needs, problem is that I don't know what's the type before loading certain information, for example: Loading database information I will ...

Can ConfigurationManager retain XML comments on Save()?

I've written a small utility that allows me to change a simple AppSetting for another application's App.config file, and then save the changes: //save a backup copy first. var cfg = ConfigurationManager.OpenExeConfiguration(pathToExeFile); cfg.SaveAs(cfg.FilePath + "." + DateTime.Now.ToFileTime() + ".bak"); //reopen the original c...

How to change configs in Spring.Net

An advantage of an IoC container is that you can swap in a mock service at the bottom of your object graph. However this seems much harder to do in Spring.Net than in other IoC Containers. Here's some code that does it in Unity and has Spring.Net code; namespace IocSpringDemo { using Microsoft.Practices.Unity; using NUnit.Framew...

How to version control config files pragmatically?

Suppose we have a config file with sensitive passwords. I'd like to version control the whole project, including the config file as well, but I don't want to share my passwords. That could be good, if this config file: password=secret foo=bar becomes password=* foo=bar and the other users of the vcs could also set up the password o...

Export with alphabetical sort in Python ConfigParser

Is there any solution to force the RawConfigParser.write() method to export the config file with an alphabetical sort? Even if the original/loaded config file is sorted, the module mixes the section and the options into the sections arbitrarily, and is really annoying to edit manually a huge unsorted config file. PD: I'm using python 2...

Changing App.config at Runtime

I'm writing a test winforms / C# / .NET 3.5 application for the system we're developing and we fell in the need to switch between .config files at runtime, but this is turning out to be a nightmare. Here's the scene: the Winforms application is aimed at testing a WebApp, divided into 5 subsystems. The test proccess works with messages b...

Algorithm to parse a config file in php (Doxygen file)

hi, I have a conf file like this: http://pastie.org/768582 and my goal is to get in an array the comments and the key/value of each keys. array( array( 'comment' => "The PROJECT_NAME tag is a single", 'key' => "PROJECT_NAME", 'value' => "JMK", ), ) I would know what algoritm do I have to use? I have already tra...

Can I use the ReplaceConfigSections task in a non-web config file?

Brennan Stehling blogged back in 2007 about how to make use of the MSbuild tasks in Web Deployment Projects to merge web.config files directly in an MSBuild script without having to create a separate WDP project. I'd like to use this technique in a non-web project (in this case a Windows Service exe app). I'm currently trying this dire...

Packaging Python applications with configuration files

I'm using ConfigParser for configuring my application, and now I want to make it easily distributable, and at the same time preserve the configurability. I'm thinking I need a directory with configuration file templates, and some way of generating the configuration to actually use from these. Then I need a place to store it that will w...

.NET Compact Framework config files.

Hello! I'm developing a Windows Mobile 5.0 or above WinForm application using .NET Compact Framework 2.0 SP2 and C#. I need to use a config file to store a Web Service's URL and other information encrypted. I've read something about Mobile Configuration Application Block from Mobile Client Software Factory. Can I use this? Is there a...

Are IoC containers about configuration files?

Recently I developed a performance tester console application, with no UI, with the help of a IoC containter (Castle-Windsor-Microkernel). This library enabled me to let the user choose which test(s) to run, simply by changing the configuration file. Have I realized what IoC containers are about? I'm not sure. Even Joel said here on SO ...

File level configuration? C# and Reflection?

I have a file with a dozen classes and i use reflection to generate data from it. I was thinking it may be cool if i had a way to configure all of the classes in that file at once. How might i do this? -edit- everyone seems confused. I posted a possible solution below. I want to attach data to a file. While using reflection i would lik...

Use a Spring XML entity to set a property in an Annotated File?

I have a Spring MVC Controller class that needs a property set from a config.properties file. I was thinking that since I already use this config file to set some db properties, I could access it in a similar way to set this property. The difference is that my Controller class is annotated and not declared in an XML file, so I can't se...