Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Setup / August 2003

Tip: Looking for answers? Try searching our database.

Configuration Files - myapp.exe.config or app.config ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DotSpy - 28 Aug 2003 19:35 GMT
I did build a small VB Net application with a
configuration file called myapp.exe.config and it worked
OK.
My code is simply reading parameters (db path, trace
file...)
But at one point, I decided to test the dynamic key
mapping of the Treeview control (Dynamic
properties/Advanced...)
I expected a line to be added as "<add
key="TV_Favorites.AllowDrop" value="False" />".
To my surprise it overwrote my config file
(myapp.exe.config in \bin) and created a new config file
app.config in the project root.
My questions are :
- why are there TWO config files, myapp.exe.config and
app.config ?
- is it wise to keep only app.config ?
- why is this config file overwritten by dynamic
parameters ?
Jay B. Harlow [MVP - Outlook] - 29 Aug 2003 16:28 GMT
DotSpy,
> - why are there TWO config files, myapp.exe.config and
> app.config ?
This is normal.

Microsoft fixed a 'feature' of VS.NET 2002 in VS.NET 2003. :-|

You need to add your config file to your VS.NET project's root folder as
app.config, it needs to be named "app.config" without the quotes. When you
build your project VS.NET (both 2002 & 2003) will copy the app.config file
from the project root to your output folder and name it appropriately
(myproject.exe.config).

> - is it wise to keep only app.config ?
With VS.NET 2003 it is the only option, VS.NET 2002 had the 'bug' that was
fixed. Hopefully VS.NET 2004 keeps the VS.NET 2003 behavior as it seems the
most correct...

> - why is this config file overwritten by dynamic
> parameters ?
Which one is overwritten, the one in the bin folder. The folder that has all
the outputs from the build? Remember the config file is an output from the
build also, so it gets replaced with the app.config that is part of your
project. Also the app.config will be named correctly, so if you change
project properties the config created in the bin folder will be correct.

Hope this helps
Jay

> I did build a small VB Net application with a
> configuration file called myapp.exe.config and it worked
[quoted text clipped - 15 lines]
> - why is this config file overwritten by dynamic
> parameters ?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.