Reputation: 33116
I add these pre-build Events and post-build Events in the Visual Studio 2010.
Now if I build the project I will be able to see the following:
1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------
1>Build started 2015-08-18 5:50:09 PM.
1>InitializeBuildStatus:
1> Creating "Debug\HelloWorld.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>PreBuildEvent:
1> Hello
1>ClCompile:
1> HelloWorld.cpp
1> HelloWorld.vcxproj -> C:\Users\yuchen\Desktop\HelloWorld\Debug\HelloWorld.exe
1>PostBuildEvent:
1> Byebye
1>FinalizeBuildStatus:
1>
1>Build succeeded.
I repeat the same process for Visual Studio 2013, for whatever reason, I am not sure whether the pre-build event and post-build event are actually running or not.
Is the output moved to a different window? Is there other settings to make the pre-build and post-build event working?
1>------ Rebuild All started: Project: HelloWorld2, Configuration: Debug Win32 ------
1> stdafx.cpp
1> HelloWorld2.cpp
1> HelloWorld2.vcxproj -> C:\Users\yuchen\Desktop\Win32Project1\Debug\HelloWorld2.exe
Upvotes: 5
Views: 5983
Reputation: 942207
Well, no, it isn't running. If you want to make absolutely sure then just generate an intentional build error:
exit /b 1
Do note that you are not using the same build settings, you've configured VS2010 to be more verbose. Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity. You've got VS2010 set to "Normal" but VS2013 to "Minimal". So you want to probably change it for VS2013 so you get what you were used to.
Just watch out for a very annoying bug in VS2013, I've lost countless minutes of my life on it. When you use Project > Properties to change settings then it doesn't always present the settings for the configuration+platform you've got selected in the toolbar. You are building Win32+Debug, make sure that the comboboxes at the top of the dialog are also selected to Debug and Win32. And do keep in mind that you have edit pre/post-build events then you have to do so for all combinations of configuration and platform.
Upvotes: 4