Results 1 to 2 of 2

Thread: App.config overwrites exe.config

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Location
    China
    Posts
    7

    App.config overwrites exe.config

    Hi,

    I am developing an application from VS.Net 2003.

    I have found that if I read and write user settings to the exe.config file located in the bin, it gets overwritten by the contents of app.config when I start the application and stop the application.

    Because of this I started writing and reading the app.config but find that this is an incorrect approach as the app.config is used only when I run the application from VS.Net 2003.

    What is the solution to this problems.... what I thought of is this-
    write some code that will check if the app was run from Vs.Net and if so, write and read from app.config....otherwise write and read from exe.config in bin folder.


    Any suggestions are greatly appreciated.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    When you compile your project the app.config file used in your project overwrites the one in the bin, this is intended behavior to carry over any changes. This only matters during development since the normal users of your app wont be compiling it. If you want a test exe then just copy the needed exe and app.config file to another directory and use those.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width