Msbuild是否识别除DEBUG | RELEASE以外的任何构建配置 [英] Does Msbuild recognise any build configurations other than DEBUG|RELEASE

查看:68
本文介绍了Msbuild是否识别除DEBUG | RELEASE以外的任何构建配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Visual Studio创建了一个名为Test的配置,该配置目前仅接受所有DEBUG设置,但是如果构建恰好是TEST | DEBUG | RELEASE,我将使用编译器条件来确定一些特定的操作.

I created a configuration named Test via Visual Studio which currently just takes all of DEBUG settings, however I employ compiler conditions to determine some specific actions if the build happens to be TEST|DEBUG|RELEASE.

但是我如何获得我的MSBUILD脚本来检测TEST配置?

However how can I get my MSBUILD script to detect the TEST configuration??

目前,我正在构建

 <MSBuild Projects="@(SolutionsToBuild)" Properties="Configuration=$(Configuration);OutDir=$(BuildDir)\Builds\" />

@(SolutionsToBuild)是我的解决方案.在常见的MsBuild项目属性中,它指出$(Configuration)是一个共有财产,但总是空白?

Where @(SolutionsToBuild) is a my solution. In the Common MsBuild Project Properties it states that $(Configuration) is a common property but it always appears blank?

这是否意味着它永远不会被设置,而只是保留给我使用,或者它只能检测DEBUG | RELEASE.如果是这样,那么允许创建不同的构建配置的意义何在?

Does this mean that it never gets set but is simply reserved for my use or that it can ONLY detect DEBUG|RELEASE. If so what is the point in allowing the creation of different build configurations?

推荐答案

我在定义MSBUILD配置文件方面做得并不多,但是我使用这样的批处理文件完成了不同配置的构建

I haven't done much with defining an MSBUILD configuration file but I have done builds of different configurations using a batch file like this

msbuild /v:n /p:Configuration=Release "Capture.sln" 
msbuild /v:n /p:Configuration=ReleaseNoUploads "Capture.sln" 

我在Visual Studio中定义了 ReleaseNoUploads 配置.

I defined the ReleaseNoUploads configuration inside Visual Studio.

这就是我要做的(这是Visual Studio 2005):

Here's what I had to do for that (this is Visual Studio 2005):

  • 打开 Tools:Options 菜单,转到 Projects and Solutions:General 选项,然后选中 Show Advanced build configuration . li>
  • 从那里转到 Build:Configuration 管理器菜单
  • 在弹出的对话框中,单击<活动解决方案配置下拉菜单,然后单击< New ...> 创建新的构建配置.
  • li>
  • Open the Tools:Options menu, go to the Projects and Solutions:General option, and check Show advanced build configurations.
  • From there, go to the Build:Configuration Manager menu
  • In the dialog that pops up, click on the Active solution configuration pulldown and click <New...> to create a new build configuration.

这篇关于Msbuild是否识别除DEBUG | RELEASE以外的任何构建配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆