简体   繁体   中英

Click Once Deployment and Solution Configuration

Is there an easy way to configure different configuration files for publishing with click once in a WinForms application? I'm looking to create a Settings/app.config depending on the solution configuration, ie: Debug/Release, and have the same setting keys, but pointing to different machines/db's for development/production connections for each solution configuration.

Thanks,

Mark

Sadly, unlike ASP.Net VS2010 does not support different config files for Debug/Release. Its frustrating that the various VS teams don't co-ordinate a little better as the feature in ASP is very useful.

Really, the only place to change the app.config for your debug vs release is in your build process after running msbuild.

I wrote and sell a piece of software called ClickOnceMore that supports different environments (debug, staging, QA, production etc) using a macro approach. You can define a different value for each macro depending on the build type (which can be passed in on the command line). You can then use the value of those macros to either pick up a different config file or to replace values in a config file template.

A simpler approach in ClickOnceMore lets you use the built in macro [DebugOrRelease] to pick up a different config file for Debug or Release builds.

You can download a free trial of ClickOnceMore here: www.clickoncemore.net if you have any problem making your scenario work just let me know, it should be able to do exactly what you want to do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM