By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,467 Members | 1,448 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,467 IT Pros & Developers. It's quick & easy.

Sharing config file between two exes?

P: n/a
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
May 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

May 16 '06 #2

P: n/a
Adding to my previos post, you certainly can use System.Xml namespace to read
that config file

"Jonny" wrote:
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

May 16 '06 #3

P: n/a
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

May 16 '06 #4

P: n/a
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jonny" wrote:
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

May 16 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.