Question

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. :)

Was it helpful?

Solution

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.

OTHER TIPS

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top