I have searched the net which has quite a few similar answers but they seem to differ with VS version. Each was differing so I though that I should ask you guys
So here is some detail.
i need to copy the dll at
"C:\MyProjects\Visual Studio\Mylibrary Library\Mylibrary \Mylibrary \bin\Release\Mylibrary.dll"
to
"C:\MyProjects\Unity\Projects\Valding\Valding\Assets\Classes\VadingClasses"
In your post-build event, give the following xcopy
a shot...
xcopy "$(ProjectDir)bin\Release\Mylibrary.dll" "C:\MyProjects\Unity\Projects\Valding\Valding\Assets\Classes\VadingClasses" /Y
Here are some common switches used with xcopy, as well as the command syntax
xcopy "your-source-path" "your-destination-path"
/I
- treat as a directory if copying multiple files/Q
- Do not display the files being copied./S
- Copy subdirectories unless empty./E
- Copy empty subdirectories./Y
- Do not prompt for overwrite of existing files./R
- Overwrite read only files.Note that copy
should work as well for you as well in this case, but xcopy
should afford you some benefit if you wish to copy more than just a single file at some point. Check out these various further reading resources:
Pre-build Event/Post-build Event Command Line Dialog Box - available macros you may wish to leverage e.g. $(ProjectDir)
COPY, XCOPY and ROBOCOPY Command Lines - explanation regarding similarities/differences