UserControl & XML Config File

G

Guest

Hi,

I'm trying to create a WinForms application that has a dynamic Menu driven
via an XML file. I have created a UserControl which encapsulates this
functionality, the problem is the location of the XML file. I would like some
advice on the best way to achieve this...

My current thinking is to create a sub directory structure below the exe
following deployment that will contain the configuration file. I can then use
the Application.StartupPath to determine the location of the installed exe
and expect to find the xml file below it. This all works fine in the deployed
senario but when i'm using the designer it is looking for the XML file in
C:\Program Files\Microsoft Visual Studio 8\Common7 ....

I could get my usercontrol to return if the file is not found but I like the
idea that the load event is run and I can see the final look of the control
in both the design and deployed state. Is their a better or recommended way
to do this? I don't want to have everything in the app.config file since
there will be many XML files.

Thanks
N
 
L

Lee

Assuming that it is not feasible for the data in the XML-files to be
placed in the app.config file; how about putting the path to those
files there.
 
G

Guest

Yeh thats what I've gone for at the moment. Seems like the best solution to
me but glad to hear someone else suggest it.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top