I am using VS 2010 Ultimate on Windows 7 Home Premium x64. I originally wanted my post build event to run on a successful build AND release configuration. In other words, skip the post-build event for Debug. That isn't possible in a straighforward fashion.
As it turns out (apparently) the post-build event is written to a batch file that is subsequently executed. That being said I tried to do the following in the Post-Build event:
if "$(ConfigurationName)" == "Release" (
SET EXE="N:\My.Net\Tools\SolutionPostProcessor.exe"
ECHO %EXE%
%EXE% <list of command line parameters built with VS macros
)
Now, when I set my configuration to Release I see only the following:
WebApplication -> drive:/path/to/webapplication.dll
ECHO IS ON
And that is it, the %EXE% execution is skipped totally as if there was nothing on that line. If on the other hand I replace that with the lengthy path to the executable plus its command-line parameters, then it is executed. Apparently VS.2010 post build
events is ignoring user-set variables (btw it is NOT an environment variable)
degt
Member
195 Points
171 Posts
VS 2010 ignores variable in Post build event
Dec 14, 2011 03:25 PM|LINK
I am using VS 2010 Ultimate on Windows 7 Home Premium x64. I originally wanted my post build event to run on a successful build AND release configuration. In other words, skip the post-build event for Debug. That isn't possible in a straighforward fashion.
As it turns out (apparently) the post-build event is written to a batch file that is subsequently executed. That being said I tried to do the following in the Post-Build event:
if "$(ConfigurationName)" == "Release" ( SET EXE="N:\My.Net\Tools\SolutionPostProcessor.exe" ECHO %EXE% %EXE% <list of command line parameters built with VS macros )Now, when I set my configuration to Release I see only the following:
WebApplication -> drive:/path/to/webapplication.dll ECHO IS ONAnd that is it, the %EXE% execution is skipped totally as if there was nothing on that line. If on the other hand I replace that with the lengthy path to the executable plus its command-line parameters, then it is executed. Apparently VS.2010 post build events is ignoring user-set variables (btw it is NOT an environment variable)
Contributor to Panama Vibes