msbuild,定义条件编译符号
- 作者: 扫黄大队长_
- 来源: 51数据库
- 2023-02-13
问题描述
我可能只是瞎了眼,但是有没有命令行可以在 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:WINDOW**icrosoft.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"
- C#通过fleck实现wss协议的WebSocket多人Web实时聊天(附源码)
- 团队城市未满足要求:MSBuildTools12.0_x86_Path 存在
- 使用 MSBuild.exe 在发布模式下构建 C# 解决方案
- 当我发布 Web 应用程序时,AfterPublish 脚本不运行
- 构建时 T4 转换的产品仅在下一个构建中使用
- ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json
- 新的 .csproj 格式 - 如何将整个目录指定为“链接文件"到子目录?
- 如何将条件编译符号(DefineConstants)传递给 msbuild
- MSBuild 支持 Visual Studio 2017 RTM 中的 T4 模板
- NuGet 包还原找不到包,没有源