如何查找Visual Studio项目中缺少的文件? [英] How do I find files that are missing from visual studio projects?

查看:252
本文介绍了如何查找Visual Studio项目中缺少的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于合并等问题,我们有很多项目文件未包含其文件夹中的所有源代码文件.

Due to issues with merging etc, we have lots of project files that don’t contain all source code files that are within their folders.

在我编写一个小工具来检查项目文件中是否包含每个*.cs文件之前,我希望确保之前没有其他人这样做过.

Before I write a little tool, that checks that every *.cs file is included in a project file, I wish to make sure that no-body else has already done that before.

(我们有将近100个项目文件和1000个C#文件)

(We have close to 100 project files, and 1000s of C# files)

很明显,Visual Studio现在对使用通配符包括项目中给定目录中的所有"* .cs"文件的支持是解决此问题的最佳方法.这样,添加".cs"文件(重命名为ete)时就无需更新项目文件.但是,只有在VS2017中,才可以从UI中使用它.

Clearly the support that visual studio now has for using wildcards to include all "*.cs" files from a given directory in the project is the best solution to this problem. In that there is then no need to update project files when ".cs" files are added, renamed ete. However it is only in VS2017 that this become usable from the UI.

推荐答案

有了这么多的文件和项目,听起来您可能希望自动化一些.但是,有一种手动方法(不确定您是否已经知道):

With that number of files and projects, it sounds like you might want something more automated. However, there is a manual approach (not sure if you are already aware of it):

  1. 在解决方案资源管理器"窗格中选择项目
  2. 项目菜单->显示所有文件
  3. 在项目下,不属于项目的文件将显示为幽灵"图标
  4. 选择所需文件,然后从上下文菜单中选择包含在项目中"

这篇关于如何查找Visual Studio项目中缺少的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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