Re: Where should I put my configuration file?
- From: Duggi <DuggiSrinivasaRao@xxxxxxxxx>
- Date: Thu, 19 Jun 2008 23:25:25 -0700 (PDT)
On Jun 19, 9:09 pm, Author <gnewsgr...@xxxxxxxxx> wrote:
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";
?- Hide quoted text -
- Show quoted text -
If they are small size images like, gif or icons... they can directly
go into resources, If you believe resource file will get more in size,
try using them as external resources.
under properties you can see resources.resx in the solution
explorer.... I hope you can explore from there
-Cnu
.
- References:
- Where should I put my configuration file?
- From: Author
- Re: Where should I put my configuration file?
- From: Duggi
- Re: Where should I put my configuration file?
- From: Author
- Where should I put my configuration file?
- Prev by Date: Re: LINQ to object query construction
- Next by Date: Re: Cleanup code for .net 3.5
- Previous by thread: Re: Where should I put my configuration file?
- Next by thread: Visual Studio 2005 Login Components and ASPNETDB
- Index(es):
Relevant Pages
|