Is there a way to automatically use a separate app.config when building in release mode?
In other words, I want to test with one app.config, and release with another.
Currently, I keep a separate copy called app.config.production, and manually overwrite bin\Release\Application.exe.config after building for release.
Visual Studio projects have separate release and debug configurations for your program. You build the debug version for debugging and the release version for the final release distribution. In debug configuration, your program compiles with full symbolic debug information and no optimization.
Major differences are the debug apk and the release apk: For debug builds the apk will be signed with the default debug signing keys with debug flag enabled. For release apk you will have to explicitly specify the apk to sign with and the debug flag will be turned off so that it cannot be debugged.
I have recently posted a supremely belated response to a similar SO topic: https://stackoverflow.com/a/27546685/2798367
I will repeat it here for clarity:
This is somewhat late to the party, but I stumbled upon a nice way of implementing the web.transform
approach for app.config
files. (i.e. it makes use of the namespace http://schemas.microsoft.com/XML-Document-Transform
)
I think it is "nice" because it is a pure xml approach and doesn't require 3rd party software.
A parent / default App.config file is descended from, according to your various build configurations. These descendants then only override what they need to. In my opinion this is much more sophisticated and robust than having to maintain x
number of config files which get copied in their entirety, such as in other answers.
A walkthrough has been posted here: http://mitasoft.wordpress.com/2011/09/28/multipleappconfig/
Look, Mom - No explicit post-build events in my IDE!
Unload the project in Solution Explorer via the context menu.
Edit the .csproj
file via the context menu and add this:
<PropertyGroup> <AppConfig>App.$(Configuration).config</AppConfig> </PropertyGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With