MSBuild task - Build fails because one solution being built in release instead of debug

﹥>﹥吖頭↗ 提交于 2019-12-01 23:10:41

Make sure that all your build scripts have this section:

<ConfigurationToBuild Include="Debug|Any CPU">
  <FlavorToBuild>Debug</FlavorToBuild>
  <PlatformToBuild>Any CPU</PlatformToBuild>
</ConfigurationToBuild>

and that it is set to "Debug".

Here is a sample of our build file that forces the build to be made in release or debug mode <

MSBuild Projects="$(RootPath)\Source\Website.csproj"
                 Targets="ResolveReferences;_CopyWebApplication" Properties="Configuration=$(BuildConfiguration);WebProjectOutputDir=$(DeploymentFolder);OutDir=$(DeploymentFolder)\bin\" />

Configuration=$(BuildConfiguration) is the key in the above sample. Replace the $BuildConfiguration with your build environment or provide it from the command line(which is what we do). This will force the build in the mode you want. Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!