Re: Where should I put my configuration file?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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";

?
.



Relevant Pages

  • Re: Unable to set DISPLAY localhost:0.0 / Solved
    ... [root@localhost root]# date ... # This is the ssh client system-wide configuration file. ... # Kerberos TGT Passing only works with the AFS kaserver ...
    (Fedora)
  • Re: Enabling telnet, ftp, pop3 for root...
    ... would be impossible to admin a system without giving access to an ... files without needing to use an editor as root. ... writable space of a user over a system-wide configuration file. ...
    (alt.os.linux)
  • Re: Enabling telnet, ftp, pop3 for root...
    ... You can write small wrapper scripts or programs, ... files without needing to use an editor as root. ... writable space of a user over a system-wide configuration file. ...
    (alt.os.linux)
  • Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem.
    ... What happens if the root tampers udev's configuration file? ... But root doesn't need access to these files, ... You can forbid mknod/unlink /dev/null if you want nobody to do so. ... You can forbid all operations on /dev (except udev) with an ACL. ...
    (Linux-Kernel)
  • Re: Where should I put my configuration file?
    ... the configuration file cannot be found. ... How about image files which I place under a folder called "images"? ... Should I simply put the folder under the application root, ... try using them as external resources. ...
    (microsoft.public.dotnet.languages.csharp)