问题
The Pre/Post Build Events in Visual Studio has bugged me for a few years, but I just haven't got around to research a better alternative. The thing that I want to achieve is pretty much the same as I get with Post Build Events: I call a piece of code that does something before or after a project build.
The two things with the Pre/Post Build Events that really bugs me is that (1) the code is separated from my project and compiled into a command line .exe and (2) that every error I get will end up as a cryptical message in the error pane.
I would ideally want to write a static method inside my project that gets called before or after the project builds and if an exception pops up, it gets stack traced like any other exception in debug mode.
What existing (simple) approach can I use to get something like this done?
来源:https://stackoverflow.com/questions/16550034/alternative-to-pre-post-build-events-in-visual-studio