且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何让 Visual Studio 将 DLL 文件复制到输出目录?

更新时间:2022-03-01 01:09:56

在您的项目中使用构建后操作,并添加命令以复制有问题的 DLL.构建后操作编写为批处理脚本.

Use a post-build action in your project, and add the commands to copy the offending DLL. The post-build action are written as a batch script.

输出目录可以被引用为$(OutDir).项目目录以 $(ProjDir) 形式提供.尝试在适用的情况下使用相对路径,以便您可以复制或移动项目文件夹而不会中断构建后操作.

The output directory can be referenced as $(OutDir). The project directory is available as $(ProjDir). Try to use relative pathes where applicable, so that you can copy or move your project folder without breaking the post-build action.