PC Review


Reply
Thread Tools Rate Thread

config files question for console apps / windows apps

 
 
jai hanuman
Guest
Posts: n/a
 
      12th Mar 2004
hi,
where can you set the "startup" directory for the config files? (like
in the ini days). In those days, the project directory would be the
startup and search path for the ini files.

now however, i found that the myapp.exe.config does not get picked
from the folder where myapp.csproj is. It seems to pick it up only
from myapp/bin/debug (or release) folder (when in the IDE). When
i copy the config file there, on every compile it cleans out the folder
and deletes the config file.

In the program i tried to set the AppDomainSetup.ConfigurationFile
to two levels up, but it just ignores that change and the directory
path after the call remains the same as before.

Question: how do you get you program to read the config from the
project root? I do not want a hack (post-build step) to copy the
config to bin/debug.

Thanks a lot.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UG9ja2V0TmVyZA==?=
Guest
Posts: n/a
 
      13th Mar 2004
If you are using VS.NET 2003 you can add an app.config file to your project

This 'is' your configuration file - it will be renamed to the correct name of your application.exe.config and copied to the debug or release folder automatically

HT

RS
 
Reply With Quote
 
Nico Debeuckelaere
Guest
Posts: n/a
 
      15th Mar 2004
..NET always takes the config from the same directory as where the exe is
located.
But you can add a config file into your project.
In VB.NET it will be named app.config.
During build ... .NET will copy this file to the same directory as the EXE
and rename it as blabla.exe.config

Regards,

--

Nico Debeuckelaere

ND-Sign BVBA (Microsoft Certified Partner since 2004)
URL: http://www.nd-sign.com
== ND-Sign, Designed for you ==
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


"jai hanuman" <(E-Mail Removed)> wrote in message
news:c2teaa$20fi5t$(E-Mail Removed)...
> hi,
> where can you set the "startup" directory for the config files? (like
> in the ini days). In those days, the project directory would be the
> startup and search path for the ini files.
>
> now however, i found that the myapp.exe.config does not get picked
> from the folder where myapp.csproj is. It seems to pick it up only
> from myapp/bin/debug (or release) folder (when in the IDE). When
> i copy the config file there, on every compile it cleans out the folder
> and deletes the config file.
>
> In the program i tried to set the AppDomainSetup.ConfigurationFile
> to two levels up, but it just ignores that change and the directory
> path after the call remains the same as before.
>
> Question: how do you get you program to read the config from the
> project root? I do not want a hack (post-build step) to copy the
> config to bin/debug.
>
> Thanks a lot.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Tries to Reinstall Apps whenever certain other apps are Run? Zoyanot Windows XP General 5 16th Jun 2007 04:07 PM
Easy question regarding console apps Paul Hemans Microsoft VC .NET 4 28th Mar 2007 02:52 AM
Multithreading, Windows Forms vs Console Apps MeowCow@gmail.com Microsoft C# .NET 6 8th Dec 2005 09:31 PM
GUI and Console Apps MumboJumbo Microsoft C# .NET 12 24th May 2005 04:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:33 AM.