Visual Studio post build event returns error MSB3073


Is your Visual Studio instance returning error code MSB3073 while executing the post build event? If you faced such error message and already spent time on investigating the root cause, you came to a proper landing page.

 

Recently, I too faced it and later noticed the cause which I am going to document here to save your further investigation time. Hope that helps.

 

Visual Studio post build event returns error MSB3073 (www.kunal-chowdhury.com)

 

If you are using Visual Studio and encountered the following error “Visual Studio post build event returns error MSB3073” while executing commands written in the post build event section of any project, this could be due to invalid path.

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(4291,5): error MSB3073: The command 'if 'Release'=='Release' (

...

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(4291,5): error MSB3073: )' exited with code 9009. -- FAILED"

 

Recently, I encounter this error and after investing a lot of time on the analysis, I noticed that, I was using ‘xcopy’ command in one of the project and in the other one ‘SignTool’. Unfortunately, none of the commands were being picked up by the Visual Studio IDE while compiling the solution/project.

 

In case you are facing such issue, just put a absolute path of the commands that you are using inside the post build event and it will start working.

 

There could be other reason too. As I have already found this after a lot of investigation, sharing this to save your effort that I already put. Did this trick work? Please share your comments.

 

 


If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter, Facebook, Google+ and LinkedIn. I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.

0 comments

 
© 2008-2016 Kunal-Chowdhury.com - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top