I have a project with a post build event:
copy $(ProjectDir)DbVerse\\Lunaverse.DbVerse.*.exe $(TargetDir)
It works fine every time on my m
I just received the same error. I had a % in the destination path that needed to be escaped
c:\projects\%NotAnEnvironmentVariable%
needed to be
c:\projects\%%NotAnEnvironmentVariable%%
I had to run VS as Administrator to get my post-build copy to an OS protected "..\Common7\IDE\PrivateAssemblies" to work
The one with the "Pings" helped me... but may be explained a little better...
For me the solution was to change:
copy $(TargetDir)$(TargetName).* $(SolutionDir)bin
to this:
copy "$(TargetDir)$(TargetName).*" "$(SolutionDir)bin"
Hope it works for you. :-)
So many solutions...
In my case, I had to save the bat file with non-unicode (Western, Windows) encoding. By default when I added the file to visual studio (and probably I should have done it outside of the VS), it added with UTF-8 encoding.
As a matter of good practice I suggest you replace the post build event with a MS Build File Copy task.
My reason for the Code 1 was that the target folder was read only. Hope this helps someone! I had a post build event to do a copy from one directory to another and the destination was read only. So I just went and unchecked the read-only attribute on the directory and all its subdirectories! Just make sure that its a directory that's safe to do so!