Re: Where should I put my configuration file?



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
.



Relevant Pages

  • Re: Satellite Assemblies... a boring problem
    ... in the root directory of executable or in the project root ... > i've got a problem woth localized assembly resources. ... > Under application root i've two folder... ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Where should I put my configuration file?
    ... debug starts, the executable is placed under ApplicationRoot/bin/ ... Add new item "Application configuration file" to the project and place ... How about image files which I place under a folder called "images"? ... Should I simply put the folder under the application root, ...
    (microsoft.public.dotnet.languages.csharp)
  • 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)
  • Company Web Issues
    ... is located in a folder called ClientHelp. ... I Copy ClientHelp folder from ... An error occurred during the processing of a configuration file ... Source Error: ...
    (microsoft.public.windows.server.sbs)
  • Re: ERROR: SetFolder while using old Config folder/file with Outlook 2
    ... It might be helpful to know more about what you mean by "with some 3rd party ... Sue Mosher, Outlook MVP ... > folder must be of type "Mail Items" to operate correctly. ... > Configuration File. ...
    (microsoft.public.outlook.program_forms)