Copy bin files on to Physical file location on Pos

2019-01-13 08:14发布

I want to copy my dll generated in bin folder to a file location on Post Build Event in vs2010.

Can some one help me on that.

Thanks

4条回答
时光不老,我们不散
2楼-- · 2019-01-13 08:30

You want to add something like:

xcopy /Q /Y "$(TargetPath)" "C:\path\to\somewhere\"

to you post-build event on the Build Events tab in the project properties page. The /Y will stop it from prompting you to confirm an overwrite.

If you also need to copy the .pdb file, you will need something like this:

xcopy /Q /Y "$(TargetDir)$(TargetName).*" "C:\path\to\somewhere\"

You can see more substitution tokens (the $XXX values) by clicking the Edit Post-build... button in the properties tab and then expanding the Macros>> button.

查看更多
做自己的国王
3楼-- · 2019-01-13 08:31

Right-click the project, then go to Properties->Build Events->Post-build command line.

Then type this in:

Cmd /C Copy "$(TargetPath)" "<YourTargetDirHere>"

Does that help?

查看更多
放荡不羁爱自由
4楼-- · 2019-01-13 08:40

We use the following post build event for copying plugin dlls to the web application's plugin directory:

copy $(TargetPath) $(SolutionDir)Convergence.WebApp\home\plugins\$(TargetFileName)

This works across multiple machines where the physical path may be different, but relies upon the destination being relative to the $(SolutionDir).

查看更多
不美不萌又怎样
5楼-- · 2019-01-13 08:43

For those of you that want to copy everything from the Output folder

xcopy "$(TargetDir)*" "C:\testpublish\updater\"  /s /Y
查看更多
登录 后发表回答