Hello experts,

I would like to know if there is a way to programmatically determine
if the app.config
is present before the application can be run? You see, I've been beta-
testing my own
application. Intentionally I renamed my "app.config" to
"app.config.orig" (or something else
if you may). The program or at least, the CLR should be able to warn
me about a missing dependency file.

After renaming the app.config, the program still runs. But naturally,
as you begin
accessing its visual controls to perform a database action which
involves instantiating
objects and such, I would get an error like: "Object reference not set
to an instance of an object."

So, before it gets to that, I want to be able to detect the presence/
absence of
the app.config at run-time. How do I do this? A simple File.Exists()
call won't do much.



Benj

Reply via email to