0

I need to make a call to a batch file when I finish my project build.

I need to make different calls based on a variable in my c# project. How can I do? This is what I need:

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

Differnt Build-event calls:

NOTIFIER version

call "$(TargetDir)CreaPacchettoNotifier.bat"

XNET version

call "$(TargetDir)CreaPacchettoXNet.bat"
  • Hi, maybe something like [this](https://learn.microsoft.com/de-de/visualstudio/msbuild/how-to-use-environment-variables-in-a-build?view=vs-2017)? – nilsK Sep 24 '18 at 14:17

1 Answers1

0

Assuming XNET and NOTIFIER are build configurations, you might as well use $(Configuration) and $(Platform)

Kris
  • 322
  • 8
  • 19
  • No, they are just constant in my project –  Sep 25 '18 at 12:55
  • Depending on the variable set do an if check whether the variable is empty or any other logic you might like - https://ss64.com/nt/if.html – Kris Sep 25 '18 at 13:06