【问题标题】:Post-build event command line based on project variable基于项目变量的构建后事件命令行
【发布时间】:2019-02-28 01:38:41
【问题描述】:

完成项目构建后,我需要调用批处理文件。

我需要根据我的 c# 项目中的变量进行不同的调用。我能怎么做?这就是我需要的:

AppHelper.cs
public enum CompilingDefines
{
    XNET,
    NOTIFIER
}
public static CompilingDefines CompiledFor { get; set; }

不同的构建事件调用:

通知器版本

call "$(TargetDir)CreaPacchettoNotifier.bat"

XNET 版本

call "$(TargetDir)CreaPacchettoXNet.bat"

【问题讨论】:

  • 嗨,也许像this

标签: c# visual-studio build post-build-event build-events


【解决方案1】:

假设 XNET 和 NOTIFIER 是构建配置,您不妨使用 $(Configuration)$(Platform)

【讨论】:

  • 不,它们在我的项目中是不变的
  • 根据变量集执行 if 检查变量是否为空或您可能喜欢的任何其他逻辑 - ss64.com/nt/if.html
猜你喜欢
  • 1970-01-01
  • 2018-04-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-24
  • 2010-10-17
  • 1970-01-01
相关资源
最近更新 更多