I\'m building a number of projects via a script, and the occasional use of custom build events causes a great deal of difficulty for the build system. If it is possible, I\
Adding this Condition to the Target for the PreBuild in the project csproj file is the only solution that worked for me. I ran into this issue trying to automate a build within VSTS where I wanted to skip the PreBuild event defined in the project csproj file. Using Visual Studio 2017, a .NET Core 2.0 project.
I tried the msbuild command line suggestions listed here but none of them worked for me.