c# - How to use the final {project}.exe.config file when creating a setup project -


i have created console application (blah.exe) specific app.config's dev , prod. these named dev_app.config , prod_app.config. have hooked afterbuild target in csproj file* copies correct config file bin directory blah.exe.config.

i have created setup project console app have run slight issue. seems setup project uses actual app.config project directory opposed final blah.exe.config (located in bin directory).

|--bin |  |--debug |     |--blah.exe.config <--- want setup project use file |--app.config <--- setup project uses file @ moment |--dev_app.config |--prod_app.config 

how can force setup project use final config file generated in bin folder , not actual app.config file?

additional information:

my current solution involves adding afterbuild command overwrites actual app.config file. don't approach since forces me have additional file don't need. also, having file has caused me grief since made changes app.config file got overwritten when building. question how setup project use final config file in bin folder , not how manage config or ways create config file.

* adapted deploy app.config based on build configuration

i have been using exact same scenario use beforebuild instead of afterbuild, , has been fine. have been doing on both web , windows projects. below code using.

  <target name="beforebuild">     <itemgroup>       <configsourcefiles include="web.$(configuration).config" />       <configdestinationfiles include="web.config" />     </itemgroup>     <copy sourcefiles="@(configsourcefiles)" destinationfiles="@(configdestinationfiles)" />   </target> 

hope helps.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -