Visual Studio 2010:如何自动将文件复制到调试目录 [英] Visual Studio 2010: how to automatically copy files into debug directory

查看:287
本文介绍了Visual Studio 2010:如何自动将文件复制到调试目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个dll,已将txt文件插入名称子目录中

I've got a dll, into which I've inserted txt files into the names subdirectory

在构建解决方案时,VS不会创建目录,也不会将文件本身复制到引用dll库的exe文件的目录中

When I build the solution, VS does not create the directory and does not copy the files themselves into the directory of the exe file, which references the dll library

有没有简单的方法可以做到这一点?

Is there an easy way to make it do that?

推荐答案

只要您在可执行项目中有对类库项目的引用,就应该这样做.我只是在Visual Studio 2010中设置了一个这样的方案:

It should do that, provided that you have a reference for the class library project in your executable project. I just setup a scenario like this in Visual Studio 2010:

  1. 创建了一个C#控制台应用程序项目
  2. 创建了一个C#类库项目
  3. 在控制台应用程序项目中添加了对C#类库项目的引用.
  4. 在C#类库项目中添加了一个名为文件"的文件夹
  5. 将文本文件添加到名为"File1.txt"的文件"文件夹中
  6. 将文本文件"File1.txt"的复制到输出目录"属性设置为始终复制"
  7. 找到一个"Build Solution",然后在我的控制台应用程序的bin目录中查找并发现其中有一个名为"Files"的文件夹,其中有一个名为"File1.txt"的文件

也许您在exe中缺少对类库的项目引用?

Maybe you are missing a project reference to your class library in your exe?

这篇关于Visual Studio 2010:如何自动将文件复制到调试目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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