Re: Where should I put my configuration file?
- From: Author <gnewsgroup@xxxxxxxxx>
- Date: Thu, 19 Jun 2008 09:09:02 -0700 (PDT)
On Jun 19, 11:14 am, Duggi <DuggiSrinivasa...@xxxxxxxxx> wrote:
On Jun 19, 7:03 pm, Author <gnewsgr...@xxxxxxxxx> wrote:
This may sound like a silly question.
I rarely do console or windows form applications.
In a console application, I have an XML configuration file. I place
it under my application root. In my code, I also say
string configFilePath = "./configuration.xml";
When I debug the application with VS 2005, I get an error which says
the configuration file cannot be found. The reason is because when
debug starts, the executable is placed under ApplicationRoot/bin/
Debug/. And as long as I don't copy this configuration.xml file to
ApplicationRoot/bin/Debug/, the complaint is justified. But to keep
copying the file is annoying every time a change is made.
And this bin/Debug folder isn't available in the VS 2005 Solution
Explorer pane. In other words, I cannot directly put the
configuration.xml file under bin/Debug/.
How do you gurus go about this? There must a more professional/easier
way to handle this. Any hint is highly appreciated.
Add new item "Application configuration file" to the project and place
your configuration in the file.
Rest of the things Visual studio takes care.
-Cnu
Thank you very much. That must the solution for configuration files.
How about image files which I place under a folder called "images"?
Should I simply put the folder under the application root, but in my
code I say:
string pathToImagesFolder = "../../images";
?
.
- Follow-Ups:
- Re: Where should I put my configuration file?
- From: Duggi
- Re: Where should I put my configuration file?
- References:
- Where should I put my configuration file?
- From: Author
- Re: Where should I put my configuration file?
- From: Duggi
- Where should I put my configuration file?
- Prev by Date: Re: Managed/unmanaged 32 bit DLL and 32 bit C# under windows x64 compatibility issues.
- Next by Date: Re: Wanted: strign searching algorithm <--- suggestions appreciated...
- Previous by thread: Re: Where should I put my configuration file?
- Next by thread: Re: Where should I put my configuration file?
- Index(es):
Relevant Pages
|