Friday, July 19, 2019

Double quote problem in Visual Studio post-build event command line

Recently I was working with OpenCV and I had to copy a dll in Visual Studio 2017 post-build event. When I tried it I got "Error MSB3073 The command "copy ... exited with code 1". When I copied and pasted the command in the error message to cmd.exe, it worked! After one day of frustration, I realized that the double quote character in Visul Studio Post-Build Event Command Line was slightly different. I copied the non-working and working versions to Notepad++ and zoomed in. The first line has the wrong double quote and the second line has the correct one:
I wrote the line first in a Google Docs and then copy-pasted it to Visual Studio, which  preserved formatting for the double quote and gave me that strange error. It was not possible for me to spot the difference in Google Docs, I only noticed it when I zoomed in Notepad++. The unbearable lightness of software development...

No comments: