2

At my company, our software for one set of services is broken out into many different solutions containing any number of 350+ projects. My job at the company is to trace through all of this code to find where errors occur.

To facilitate this, I would like to have all of the projects contained within a single solution. I can do this via the 'Add Existing Project...' menu item, but it only allows me to add one project at a time. I also noticed that I can add existing items (multiple simultaneously) from Windows Explorer by dragging them onto a solution folder, but that doesn't import projects; it only adds the project file itself to the folder.

Is there a way to add multiple projects to a solution simultaneously? I realize that this may (read: will) take a long time.

gregsdennis
  • 7,218
  • 3
  • 38
  • 71
  • what do you mean by errors? What kind of errors are you looking for? is there a way to create a log file to track the errors down? – Chucri Dec 30 '11 at 15:08
  • Exceptions that are being thrown. But that is irrelevant to the question. – gregsdennis Dec 30 '11 at 15:11

3 Answers3

5

I think you are looking for something like this: http://nprove.codeplex.com/

This allows to load a a project or a folder with projects from the team foundation source control explorer into the current solution.

Jose Luis
  • 51
  • 1
  • 2
3

A solution would be to create a small program that takes as input the list of projects you want to add to your solution (or that scans a directory for *.csproj, *.vbproj...) and writes to the *.sln file of your solution.

If you open a *.sln file with notepad, you'll see there is no magic in it, it's just a text file that contains the list of projects (with their GUID) and some information about the build configuration. Look at the structure of a solution file and try to write a piece of code that does the same as visual studio when user adds a project to the solution.

I'm pretty sure that can be automated with a small effort. Just a matter of file parsing.

ken2k
  • 48,145
  • 10
  • 116
  • 176
  • I considered that (and directly automating VS), but I was trying to avoid having to write a program. It may be the only way... – gregsdennis Dec 30 '11 at 15:33
  • Maybe it's the simplest way. I mean, as what you want to do is something you'll do just once (I don't think you want to do this another time once your solution is build), then spending 1h to write a small program should be OK. – ken2k Dec 30 '11 at 15:40
  • Oh BTW, what do you actually want to do with your solution composed of 350+ projects? Compilations? Maybe there could be a better idea than building such a solution, like automated msbuild scripting for instance. – ken2k Dec 30 '11 at 15:43
  • There are a lot of class structure connections across all of these projects and I want one solution that contains everything rather than having to have multiple instances of VS open, each presenting one solution that only has a subset of the projects. I'm not going to compile the code, just follow the stack traces I get with the exception reports. – gregsdennis Dec 30 '11 at 17:27
  • Good suggestion. Ended up doing exactly that. Needed to fix the paths only. – Schultz9999 Mar 13 '13 at 23:32
  • An example script that does this is in http://stackoverflow.com/questions/1891035/easy-way-to-add-multiple-existing-csproj-to-a-visual-studio-solution – ivan_pozdeev Jan 25 '14 at 09:30
1

Visual Studio Extension "Add Existing Projects" (Created by: Cyotek) allows you to add multiple projects to one solution by selecting all once. Worked perfectly for me on VS2017.

smart_dude
  • 15
  • 6