Can Visual Studio 2010 automatically copy a compiled file to another directory?

余生长醉 提交于 2019-12-04 01:05:27
JaredPar

The easiest way to set this up is to use a post build event. These run once a build is successfully completed and has a set of handy macros to make access to common outputs, like compiled files, very easy

For example. Here are the steps to a compiled DLL / EXE into c:\temp

  • Right Click on the Project and select "Properties"
  • Click on the Build Events Tab
  • Add the following line to the "Post-Build" box: copy "$(TargetPath)" c:\temp

In the above $(TargetPath) is a macro for the primary output of a build task: typically the EXE or DLL file. If you click on the "Edit Post Build" button, then macros you can see the full list of supported macros.

I believe you're asking for Post Build Events

An example of what you want to do, I believe, can be found here

Is Project > Configuration Properties > Build Events > Post-Build Event what you are looking for? With a command line of something like copy <dllpath> <dest>

Visual Studio has pre and post build events that you can use to accomplish what you want to do.

just go to Project: "project name" properties you should see a tab named build events. There you should be able to create Macros to do it for you.

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!