Sharing config file between two exes?

J

Jonny

Hi,
I have two exe-files, named Test1.exe and Test2.exe that are located in the
same directory. Now I want these two exe to share the same config file. Can
this be done?

Since I created Test1.exe first, I have a file named Test1.exe.config. Can
this be used by Test2.exe?

Thanks,

Mats-Lennart
 
G

Guest

I'm not aware if it's only possible to point out other config file (seems
that it isn't possible), but you can set the postbuild event in VS to make a
copy of existed config with new name.
Hi,
I have two exe-files, named Test1.exe and Test2.exe that are located in the
same directory. Now I want these two exe to share the same config file. Can
this be done?

Since I created Test1.exe first, I have a file named Test1.exe.config. Can
this be used by Test2.exe?

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
G

Guest

Adding to my previos post, you certainly can use System.Xml namespace to read
that config file

Jonny said:
Hi,
I have two exe-files, named Test1.exe and Test2.exe that are located in the
same directory. Now I want these two exe to share the same config file. Can
this be done?

Since I created Test1.exe first, I have a file named Test1.exe.config. Can
this be used by Test2.exe?

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
G

Galcho[MCSD.NET]

you can share single .config file between two applications but not that
easy.
you must write custom code to read properties

You can use System.Xml namespace as Michael Nemtsev wrote

hope ths helps
Galin Iliev[MCSD.NET]
www.galcho.com
 
G

Guest

The AppDomain class has a ConfigFileName property but then you would need to
get into custom code to load the assembly and so on.

The default behavior for an exe is to load a config file with the same name
as the executable plus ".config"
Peter
 

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