Visual Studio 2010可以自动将编译后的文件复制到另一个目录吗?
我有两个项目,一个是编译为 EXE 的 VB6 项目,另一个是编译为 DLL 的 MSVC++2010 项目。 DLL 需要与 EXE 文件位于同一文件夹中才能工作。我可以让 Visual Studio 2010 在编译后自动将编译后的 DLL 复制到 VB6 项目文件夹吗?
I have two projects, one VB6 project which compiles to an EXE and one MSVC++2010 project which compiles to a DLL. The DLL needs to be in the same folder as the EXE file in order to work. Can I have Visual Studio 2010 automatically copy the compiled DLL to the VB6 project folder after a compilation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
设置此功能的最简单方法是使用构建后事件。 一旦构建成功完成,它们就会运行,并且有一组方便的宏可以非常轻松地访问常见输出,例如编译文件
例如, 。以下是将 DLL / EXE 编译到
c:\temp
中的步骤copy "$(TargetPath)" c:\temp
上面的
$(TargetPath)
是构建任务主要输出的宏:通常是 EXE 或 DLL文件。如果您单击“编辑构建后”按钮,那么您可以看到支持的宏的完整列表。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
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
是项目>配置属性>构建事件>构建后活动您在寻找什么?使用类似于
copy的命令行<目的地>
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 具有构建前和构建后事件,您可以使用它们来完成您想要执行的操作。
只需转到项目:“项目名称”属性,您应该会看到一个名为“构建事件”的选项卡。在那里您应该能够创建宏来为您完成此操作。
希望这有帮助。
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.