How to specify the config file for a C# program independent from any project?

  • Thread starter Thread starter Daniel Xiao
  • Start date Start date
D

Daniel Xiao

As we know, a App.config file can be specified in a C# project in the
.Net IDE. However, how to specify the App.config file for a C# program
independent of any C# project? For example, a.cs is such a C# program
that it can only be compiled by the following command line under Windows
console:

c:> csc a.cs

Seek for your guide.
 
If you are compiling your app out of VS.NET IDE, still you can specify
configuration with <ApplicationName>.exe.config file which can be placed in
the same directory.

if you have an application abc.exe, the config file for the same will be
abc.exe.config.

Sudhakar Sadasivuni
http://one.mvpblog.com
http://www.mugh.net
 
As we know, a App.config file can be specified in a C# project in the
Net IDE. However, how to specify the App.config file for a C# program
independent of any C# project?

You'd have to use one of the many third-party, extended, enhanced
..config file handlers. The standard .NET configuration system doesn't
provide any means of using anything but the app's "MyApp.exe.config"
(or web.config for ASP.NET) file.

You might want to check out www.codeproject.com and search for ".NET
configuration" or something like that - there are tons of alternatives
out there.

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Back
Top