Can I force the installer project to use the .config file from the built solution instead of the original one?

前端 未结 7 1273
我在风中等你
我在风中等你 2021-02-01 09:41

I am using the solution to this question in order to apply configuration changes to App.config in a Winforms project. I also have an installer project for the proj

7条回答
  •  星月不相逢
    2021-02-01 09:57

    I accomplished this in a different manner with no external tools:

    I added a post-build event that copied the target files to a 'neutral' directory (the root of the /bin folder in the project) and then added this file to the .vdproj. The deployment project now picks up whatever the latest built version is:

    Post Build Command:

    copy /y "$(TargetDir)$(TargetFileName).config" "$(ProjectDir)bin\$(TargetFileName).config"
    

    This worked for what I needed without any external tools, and works nicely with SlowCheetah transformations.

提交回复
热议问题