469,922 Members | 2,141 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,922 developers. It's quick & easy.

Programmatically finding machine.config

Is there a .NET framework call(s) or technique that allows one to
programmatically find the machine.config file.
Nov 19 '05 #1
2 1392
There's no public API in v1.x for reading/writing any config file (other
than resorting to an XMl parser). In v2.0 they've reworked the configuration
plumbing and now have APIs for reading and writing as well as other things
like encrypting sections of the config file (think connection strings).

-Brock
DevelopMentor
http://staff.develop.com/ballen
Is there a .NET framework call(s) or technique that allows one to
programmatically find the machine.config file.


Nov 19 '05 #2
See:
http://msdn.microsoft.com/library/de...ationtopic.asp

You could try to pass the name of a.NET assembly
to System.Reflection.Assembly.Location, and
concatenate "/config/machine.config" to the path returned.

In .NET 2.0, you can do a few things, natively, with that info.

In .NET 1.x you can't do anything, natively, with that info,
although you could manipulate the file, something I'd be very
wary about doing, since a screw-up will cost you a lot.

You should create web.config entries which override any
machine-wide settings you want changed, if that's your goal.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Kevin Jackson" <kj******@powerwayinc.com> wrote in message
news:uR**************@TK2MSFTNGP14.phx.gbl...
Is there a .NET framework call(s) or technique that allows one to
programmatically find the machine.config file.

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Hal Vaughan | last post: by
2 posts views Thread by TK | last post: by
18 posts views Thread by Praveen Ramesh | last post: by
3 posts views Thread by Codex Twin | last post: by
11 posts views Thread by TARUN | last post: by
9 posts views Thread by Dave Booker | last post: by
1 post views Thread by Cramer | last post: by
5 posts views Thread by =?Utf-8?B?SmVycnkgQw==?= | last post: by
reply views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.