Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Organising a large c# solution

Tags:

c#

.net

I have a large solution which is built daily in TFS. The solution covers multiple logical sub solutions - e.g ApplicationA which consists of projects A,B,C,D; ApplicationB which consists of projects A,B,E,F, ApplicationC which consists of projects A,C,G,H.

Currently we make a copy of the build solution file locally and unload projects we don't need to build to work on a project - so for ApplicationA we'd unload everything other than A,B,C,D.

Another approach would be to create multiple solution configurations which would only build projects A,B,C,D for ApplicationA - but I fear this would be cumbersome and the .sln file would end up huge.

The issue is that many projects are brought together into one wix package and installed together - so the main .sln file makes sense, especially from a build point of view but also debugging.

Maintaining multiple solution files doesn't seem right as when new projects are added we'd need to add them to multiple solutions. So perhaps the configuration method is the way to go, but it doesn't feel right either.

Does anybody have experience of a similar scenario, and how did you get around it?

like image 880
NDJ Avatar asked Mar 07 '13 00:03

NDJ


1 Answers

It sounds like it would make sense to have five solution files:

  • Master.sln, contains all projects
  • ApplicationA.sln, contains projects A, B, C, D
  • ApplicationB.sln, contains projects A, B, E, F
  • ApplicaitonC.sln, contains projects A, C, G, H

It's fine to have all of those solution files in the same top-level directory.

But maintaining multiple solution files isn't feasible as when new projects are added we'd need to add them to multiple solutions.

Why is that a problem? You need to work out which applications the project is required by anyway... Create the project in the master solution (which will definitely need it) and then use "Add existing project" for the solutions which need it. It's really not that much work - and I wouldn't expect that new projects are added that often anyway. (If they are, that's an indication of a bigger problem.)

like image 137
Jon Skeet Avatar answered Oct 22 '22 06:10

Jon Skeet