更改默认的“复制到输出目录"文本文件的设置 [英] Changing the Default "Copy to Output Directory" Setting for Text Files

查看:29
本文介绍了更改默认的“复制到输出目录"文本文件的设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道是否有办法更改 Visual Studio 2008 中文件类型的默认复制到输出目录"设置?

Does anyone know if there is a way to change a file type's default "Copy to Output Directory" setting in Visual Studio 2008?

我经常在我的项目中添加文本文件.它们可以是自述文件、一些使用信息或应用程序在运行时实际使用的测试文件中的任何内容.

I often add text files to my projects. They could be anything from readme files, or some usage information, or test files actually used by the app at runtime.

但我从来没有添加过一个文本文件,我不希望它在构建时复制到输出目录.

But I've never ever added a text file where I did not want it copied to the output directory on build.

我总是希望它们被复制,但我经常忘记更改设置(特别是如果我添加了一堆,就像测试文件的情况一样).我想为 Visual Studio 设置默认值,以便始终将所有 .txt 文件复制到输出文件夹.

I always want them copied, but I often forget to change the setting (esp if I am adding a bunch, as in the case of the test files). I'd like to set the default for Visual Studio so that ALL .txt files are ALWAYS copied to the output folder.

有谁知道是否有办法永久更改 .txt 文件的默认设置,以便始终复制它们?

Does anyone know if there is a way to permanently change the default setting for .txt files so they are always copied?

推荐答案

您可以通过向包含命令的项目添加 postbuild 事件来实现您想要的

You can achieve what you want by adding a postbuild event to your project containing the command

xcopy /d /y $(ProjectDir)*.txt $(TargetDir)

这篇关于更改默认的“复制到输出目录"文本文件的设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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