configuration-files

How can I include a CDATA section in a ConfigurationElement?

I'm using the .NET Fx 3.5 and have written my own configuration classes which inherit from ConfigurationSection/ConfigurationElement. Currently I end up with something that looks like this in my configuration file: <blah.mail> <templates> <add name="TemplateNbr1" subject="..." body="Hi!\r\nThis is a test.\r\n."> ...

Best pratice to save application settings in Windows application

What I want to achieve is very simple: I have a WinForms (.NET 3.5) application that uses a path for reading information. This path can be modified by the user, by using the Options form I provide. Now, I want to save the path value to a file for later use. This would be one of the many settings saved to this file. This file would sit d...

Config for WCF MSMQ in workgroup mode

In trying to deploy a service I have found that it won't start because MSMQ is in workgroup mode. I have created a private queue instead and changed the config files to refer to it, but the WCF service host refuses to start with this message: Binding validation failed because the binding's MsmqAuthenticationMode property is set to Wi...

Combining multiple config files in Visual Studio

I have a solution in Visual Studio 2008 which contains multiple C# projects. Each project has it's own config file (App.config and Settings.settings). This makes sense architecturally as each module is autonomous and is used in a number of different solutions. My problem is that when I compile the solution only the config file for the s...

Specifying connection string in config file for a class library and re-use/modify in ASP.NET Web Application

How can one specify the connection string in a config file of a class library and later modify this when used in a ASP.NET Web Application? The Class library is a data access layer that has a Dataset connecting to a database based on a connection string specified in a config file (Settings.settings/app.config). This class library is us...

How/Where to handle ConfigurationErrorsException in a windows service?

I have a windows service that has a custom configuration section. In the configSectionHandler class I am using attributes on the properties to validate the settings like this: //ProcessingSleepTime Property [ConfigurationProperty("ProcessingSleepTime", DefaultValue = 1000, IsRequired = false)] [IntegerValidator(MinValue = 5...

Which file is System.Configuration.ConfigurationManager.AppSettings using?

I want to know which *.config file the ConfigurationManager is using. How can I figure that out? For instance, you could be changing working directories and execute libraries from various paths. I'd love to have a way to display something like "Reading AppSettings from c:\MyApp\app.config" in my Trace. ...

WCF Config element: baseAddressPrefixFilters

I have read the documentation for this element but still fail to understand what its purpose is. Here is a sample of how I've seen it used in examples: <serviceHostingEnvironment> <baseAddressPrefixFilters> <add prefix="http://localhost:5100/"/&gt; </baseAddressPrefixFilters> </serviceHostingEnvironment> I want to understand w...

Do not overwrite the app.config when deploying with clickonce

How can I specify my app to not overwrite the app.config on the client machines when the app is updated by clickonce? ...

How should I store public settings? (.NET)

I'm using the application-scoped settings to store settings that cannot change at run-time. I'm using the user-scoped settings to let individual users configure their preferences. But how should I store/control settings that are modifiable at run-time by an admin-level user that are application wide (i.e., they impact all of the PC's u...

What is the difference between .resx and .config files in .NET?

When should I use .resx file and when go for .config file? What is the basic difference between the both in terms of usage? ...

How can I check if configuration file is proper?

Is there any way I can check in .net if my configuration file (I provide my own config) is proper without validating it against Xml Schema? ...

relational_database vs config_file vs spreadsheet usage

I have heard some genuine arguments for the use of relational database vs spreadsheet before. Relational database provides fast reporting and (relatively speaking) reliable data warehousing,where spreadsheets are lightweight, fast replicating, and easy to float around the organization to different audience. Although I notice the advantag...

What is the best way to store configuration variables in PHP?

I have considered the following $mysqlPass = 'password'; // doesn't seem right $config['mysql_pass'] = 'password'; // seems slightly better define('MYSQL_PASSWORD', 'password'); // seems dangerous having this data accessible by anything. but it can't be changed via this method class Config { const static MYSQL_PASSWORD = 'passwor...

How to make the Visual Studio compiler ignore a file?

Is anyone aware of a way to make visual studio completely ignore a file when compiling? I have a C# solution that has a foo.config file that isn't really a standard config file - it's just a text file. During compiling VS grabs a hold of the file and bombs. I'd like for it to act as though it's just a text file. I do not have the o...

Can I change the configuration of the Enterprise Library Logging block at runtime?

Without getting into the discussion of the merits or otherwise of the EntLib logging block, is there any way that I can change it's configuration at runtime? For example, I have the block configured to log General events to a flat file, and Critical events to the event log. Is there any way to change it to log General events to the cons...

What's the best Perl module for hierarchical and inheritable configuration?

If I have a greenfield project, what is the best practice Perl based configuration module to use? There will be a Catalyst app and some command line scripts. They should share the same configuration. Some features I think I want ... Hierarchical Configurations to cleanly maintain different development and live settings. I'd like t...

At what point does a config file become a programming language?

I have been mulling over config files and their relationship to code for a while now and depending on the day and direction of the wind my opinions seem to change. More and more though I keep coming back to the realization I first had while learning Lisp: there is little difference between data and code. This seems doubly true for conf...

FitNesse configuration files

I'm using FitNesse as a functional testing framework. I'm running into trouble when FitNesse runs code that needs configuration. If I need to get a connection string from the configuration file, I can get it to work by adding it to the FitServer.exe.config. However, I don't like that solution. I would like FitNesse to load my own config...

When is web.config read?

I'm doing research for an article on the ASP.NET Pipeline, but none of the resources I've covered so far adequately explain when the machine level, and application level, and possibly even sub-application level, web.config files are read. Also, most of my reading has mislead me to look for default HTTP handlers etc. in machine.config, w...