I\'m working on a project that requires that DLLs generated by building my solution to be copied from the bin folder to another folder, both of which are on my machine, in m
Playing around with different project properties, I found that the project build order was the problem. The project that generated the files I wanted to copy was built second, but the project that was running the batch file as a post-build event was built first, so I simply attached the build event to the second project instead, and it works just fine. Thanks for your help, everyone, though.
Following thing you should do before to run copy command if you facing some issue with copy command
I solved it by doing the following:
In Visual studio I went in Project -> Project Dependencies
I selected the XXX.Test
solution and told it that it also depends on the XXX
solution to make the post-build
events in the XXX.Test
solution not generate this error (exit with code 4
).
The Post-Build Event (under Build Events, in the properties dialog) of an imported project, had an environment variable which was not defined.
Navigated to Control Panel\All Control Panel Items\System\Advanced system settings
to add the appropriate environment variable, and doing no more than restarting VS2017 resolved the error.
Also, following on from @Seans and other answers regarding multiple project races/contentions, create a temp folder in the output folder like so,
and select the project producing the preferred output:
and build (no rebuild/clean) is a speedy solution.
I was getting this error after downloading some source code from Github. Specifically the rust oxide development framework. My problem is that the Steam.ps1 script file, that's used to update some of the dlls from Steam was blocked by the OS. I had to open the files properties an UNBLOCK it. I had not realized this was done to ps1 files as well as exes.
If the problem still persists even after putting the after build in the correct project try using "copy" instead of xcopy. This worked for me.