复制到输出目录复制文件夹结构但只想复制文件 [英] Copy to Output Directory copies folder structure but only want to copy files

查看:34
本文介绍了复制到输出目录复制文件夹结构但只想复制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 VS2008,我想将某个目录中的某些文件复制到我的 /bin/ 文件夹中.我已将文件(位于 /common/browserhawk/)设置为复制到输出目录".但是,它也会复制文件夹结构:文件被复制到 /bin/common/browserhawk/

I have a VS2008 I want to copy certain files from a directory into my /bin/ folder. I have set the files (located in /common/browserhawk/) to "Copy to Output Directory". However, it copies the folder structure as well: the files are copied to /bin/common/browserhawk/

如何将这些文件复制到 /bin/?我不想将这些存储在网站的根目录中以使其正确复制.

How do I get these files to copy to just /bin/? I do not want to store these in the root of the website to get them to copy correctly.

相关问题:Visual Studio 添加 .dll 和 .pdb 编译后进行项目

推荐答案

您可以添加构建后事件来复制文件.
转到项目属性,构建事件选项卡,并将以下内容添加到构建后事件命令行:

You can add a Post Build Event to copy the files.
Go to project properties, Build Events tab and add the following to the Post-build event command line:

copy "$(ProjectDir)commonrowserhawk*.*" "$(TargetDir)"

如果您的项目路径中有空格,请务必包含引号.

Be sure to include the quotes if your project path has spaces in it.

这篇关于复制到输出目录复制文件夹结构但只想复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆