In Visual Studio, what's the quick way to remove all exclusion files from a project?

I have a LARGE project in visual studio 2008. It has accumulated several years trying to figure out and often excluding (without deleting) files from the project. I need a way to permanently delete any excluded file. There are thousands of files and hundreds of folders. Doing this manually in the solution explorer will take too much time.

I could create a project parser and compare with the file system, but I hope for a shortcut.

thanks

+3
source share
2 answers

Are excluded files under source control along with the rest? If not, just make sure everything is checked, go to the new temporary location, move the old directory aside as a backup, and move the temporary folder to where the old one was.

If the experiments are checked for source control, this is a little more complicated - you probably have to go with the project file parser. It may not be very difficult.

EDIT: Well, if all of this is in SVN, I suggest you write a very crude project parser. Give him a list of XPath expressions (or something similar) to select "likely paths." Select everything in the project file and copy each selected file to a new location (including subdirectories, etc.). Also copy project files and solution files. Then try to build - if this fails, you missed something: repeat.

Continue until it builds, and then check it out. As long as everything is in order, you can drive everything else out :)

EDIT: here is the beginning of what I mean:

using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; public class ProjectParser { static void Main(string[] args) { XDocument doc = XDocument.Load(args[0]); XNamespace ns = "http://schemas.microsoft.com/developer/msbuild/2003"; DumpMatches(doc.Descendants(ns + "Compile") .Select(x => x.Attribute("Include").Value)); DumpMatches(doc.Descendants(ns + "AssemblyOriginatorKeyFile") .Select(x => x.Value)); } static void DumpMatches(IEnumerable<string> values) { foreach (string x in values) { Console.WriteLine(x); } } } 

(I originally tried to use XPath, but the namespace stuff made it a pain.)

+3
source

Run the command line and try DEL/S *.exclude . I don't think you'd better write an add-in for Visual Studio.

+2
source

All Articles