简体   繁体   中英

For my class Library project in visual Studio 2013 ; Using post build event how do I copy the created dll to another path?

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM