简体   繁体   中英

How to skip post-build event when compiling fails in Visual Studio 2013

I was wondering if there's any way in Visual Studio 2013 to skip running the post-build event in a C# project if the project fails to compile? Currently I have a C++ transpiler running as a post-build event, and the way it works right now it runs the transpiler (which takes forever) before Visual Studio tells me the build failed due to compiler errors. I'd much rather not run the transpiler at all if the program failed to compile.

Am I doing my post-build event incorrectly, or is there some way to configure this? Is there perhaps some sort of 'if' macro I could use in the post-build event command line that could check to see if the build was successful?

You can set to run post build event on successful build. Open project properties go in "Build Events" and set "Run the post-build event" to "On Successful build"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM