App.Config vs. AppName.exe.Config
Asked Answered
T

1

49

I'm building a Windows Service app that has configuration data stored in App.Config. However, I noticed that when I build my application a AppName.Exe.Config is generated.

Can someone tell me the relationship between these two files? Is the AppName.Exe.Config file what I install with my Windows Service app, instead of the app.config?

Thanks - Randy

Tetany answered 26/5, 2010 at 19:17 Comment(0)
A
71

App.Config is the file used in your development environment. AppName.exe.config is the app.config file used when your app is deployed.

Adamok answered 26/5, 2010 at 19:19 Comment(3)
the .exe.config file is automatically generated for you during build, based on the app.config file.Brister
@Joel - Apologies for digging up an old thread, but does this mean than settings stored by calling save() will still be there on the next execution of the program? i.e. it requires recompiling for the program to refer to app.config again, otherwise it uses the contents of appName.exe.config? So my edited settings are safe in AppName.exe.config until the next rebuild, and should I require "default" settings I can set them in app.config manually? Cheers!Elementary
@Elementary - After you deploy your product, if the program calls .save() the changed settings will still be there on the next execution of the product. That's the whole point of the feature. While still developing the product, don't edit settings in AppName.exe.config. Just don't. Edit them in App.Config. They will be moved to AppName.exe.config when needed for deployment automatically.Adamok

© 2022 - 2024 — McMap. All rights reserved.