复制到输出目录会复制文件夹结构,但只想复制文件 [英] Copy to Output Directory copies folder structure but only want to copy files
问题描述
我有一个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)\common\browserhawk\*.*" "$(TargetDir)"
如果您的项目路径中有空格,请确保将引号包括在内.
Be sure to include the quotes if your project path has spaces in it.
这篇关于复制到输出目录会复制文件夹结构,但只想复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!