There are plenty of sites where it the possibility is described to add multiple post-build events in Visual Studio (also version 2022): just add newlines.
Apparently, it's not that simple:
I am working in Windows, so the newlines should work fine, but this is the error message I get (excerpt from "Errors" window):
Severity Code Description Project File Line Suppression State
Error The command "copy C:\<Main_Dir>\bin\Debug\<Output_DLL>.dll C:\<Output_Dir_1>\
copy C:\<Main_Dir>\bin\Debug\<Output_DLL>.dll C:\<Output_Dir_2>\" exited with code 1.
It is clearly visible that the two copy
commands are treated as one (just check the presence of the double quotes).
I can confirm that the *.csproj
looks as follows:
...
<PostBuildEvent>copy $(TargetPath) C:\<Output_Dir_1>\
copy $(TargetPath) C:\<Output_Dir_2>\</PostBuildEvent>
</PropertyGroup>
...
What can I do in order to force Visual Studio 2022 to see my two post-build events as two post-build events instead of one?
I found the solution(s):
/Y
, in order to avoid the question "Do you want to overwrite?".Sorry for the inconvenience.