MSBuild的,定义条件编译符号 [英] msbuild, defining Conditional Compilation Symbols

查看:983
本文介绍了MSBuild的,定义条件编译符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能只是盲目的,但有一个命令行中MSBUILD指定条件编译符号?

I'm possibly just blind, but is there a command line to specify conditional compilation symbols in MSBUILD?

目前,我有我的buildscript这一行:

I currently have this Line in my buildscript:

SET MSBUILD=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe
SET CONFIG=Debug
%MSBUILD% /p:Configuration=%CONFIG% /p:OutputPath=..\..\output source\MyProject\MyProject.csproj

和我想补充一个条件。在Visual Studio中,我可以去到项目属性=>生成=>条件编译符号,但我还没有看到该选项的MSBuild的?

And I'd like to add a condition. In Visual Studio, i can just go into Project Properties => Build => Conditional compilation symbols, but I have not seen that option for msbuild?

奖金噶如果你知道,如果我可以完全覆盖在.csproj的文件中已作规定的所有符号,以确保只有从我Buildscript的条件语句进去的。

Bonus Karma if you know if I can completely override all symbols already specified in the .csproj files to make sure that only the conditionals from my Buildscript go in.

推荐答案

你见过<一个href="http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/95bf6b1d-9dae-48ba-b56d-08fa5ae26563/">this? (大多数信息是在倒数第二后)

Have you seen this? (most info is in the penultimate post)

/p:DefineConstants="MYSYMBOL1;MYSYMBOL2"

这篇关于MSBuild的,定义条件编译符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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