MsBuild and MsDeploy with multiple environments

前端 未结 2 1167
生来不讨喜
生来不讨喜 2021-01-30 04:36

Are there good patterns for mapping solution configurations to environments and using MsDeploy for packaging per environment?

Shortest version: Grab this file, and try t

2条回答
  •  耶瑟儿~
    2021-01-30 05:05

    I've done something similar that may be useful. In a recent project, we had 'Dev', 'Test' and 'Prod' environments.

    I added solution configurations for each of these.. eg.

    • Release-Dev
    • Release-Test
    • Release-Prod

    For most projects in the solution, these configurations were just linked to the regular 'Release' build, but where appropriate, some projects did have distinct 'Release-Test' build configurations where there might be #if/#endif stuff in the code.

    This would also make sense to allow customisation for your msdeploy config per configuration too.

    Regarding the msbuild target. The target referrs to the name of a element. eg you could call msbuild with /t:BuildWebPackage for your example above.

提交回复
热议问题