从磁盘删除不在 Visual Studio 项目中的文件

发布于 2024-07-13 10:02:13 字数 153 浏览 3 评论 0原文

任何人都可以想到一种方法(可能使用 PowerShell 脚本或类似脚本),让我可以在文件夹结构中查找磁盘上但不包含在项目文件中的 *.cs 文件吗?

随着时间的推移,随着 Subversion 等的合并,这种情况逐渐发生。基本上,我正在寻找一种自我清理的方法。 :)

Can anyone think of a way (perhaps using a PowerShell script or similar) where I can look for *.cs files that are on disk in the folder structure, but aren't included in a project file?

This has come about gradually over time with merging in Subversion etc. I'm looking for a way to clean up after myself, basically. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无人问我粥可暖 2024-07-20 10:02:13

您的所有 .cs 文件都会在项目文件中提及,对吧? 抓取 XML,列出文件,然后对整个系统进行搜索。 有效,但效率低下。

All your .cs files will be mentioned in the project file, right? Scrape the XML, list the files and then do a search on the whole system. Works, but is inefficient.

小巷里的女流氓 2024-07-20 10:02:13

解决方案资源管理器顶部的“显示所有文件”按钮,然后手动检查?

"Show all files" button at the top of Solution Explorer, then manually inspect?

四叶草在未来唯美盛开 2024-07-20 10:02:13

我的另一篇文章中的 PowerShell 脚本将执行此操作。 该脚本将从项目文件中获取包含文件的列表,并将其与磁盘上的文件进行比较。 您将获得磁盘上但未包含在项目中的一组文件。 您可以删除它们,也可以将它们作为删除挂起在 TFS 中。

脚本位于:https://stackoverflow.com/a/23420956/846428

The PowerShell script in my other post will do this. The script will get the list of included files from the project file and compare that against the files on disk. You will get the set of files that are on disk but not included in the project. You can either delete them or pend them as deletes in TFS.

The script is here: https://stackoverflow.com/a/23420956/846428

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文