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.
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
Post a Comment