views:

13

answers:

1

I have just written a small utility to be used in a pre-build event. The utilty works fine when run as standalone, but does nothing when used in the build event. Is there a standard way of noticing and dealing with error conditions in build events, or is that the domain of more advanced build control?

A: 

AFAIK, Visual Studio detects build event results by the program return code. If program returns 0, build event succeeded. Generate appropriate return code in your utility, if something is wrong. Throwing exception from a Console application is also OK, unhandled exception details are printed in the build output, and build stops.

Alex Farber
Thanks, all I needed.
ProfK