msbuild,定义条件编译符号

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

问题描述

我可能只是瞎了眼,但是有没有命令行可以在 MSBUILD 中指定条件编译符号?

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

我的构建脚本中目前有这条线:

I currently have this Line in my buildscript:

SET MSBUILD=C:WINDOWSMicrosoft.NETFrameworkv2.0.50727MSBuild.exe
SET CONFIG=Debug
%MSBUILD% /p:Configuration=%CONFIG% /p:OutputPath=....output sourceMyProjectMyProject.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 的条件进入,则奖励 Karma.

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.

推荐答案

你见过 这个?(大部分信息在倒数第二个帖子中)

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

/p:DefineConstants="MYSYMBOL1;MYSYMBOL2"

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)