Given multiple websites all running the same sourcecode, what’s the best/most maintainable way to organise these into projects within visual studio?
For example, say we have websites Red, Blue, and Green (etc). Their HTML may be different, but they are a functionally the same.
Previously in one solution we have created one project Colour, which contains a generic version of the project. Red, Blue, and Green get their own project, and each technical page is set to use the C# in Colour. (That is, there’s no unique C# for the individual implementations – all code files get removed).
However, this approach leads us to ending up with multiple individual implementation dll’s that do next to nothing, and also Other Stuff like javascript, css, and common images get duplicated accross projects.
Ideally we’d like to be able to run each project in isolation, and sourcesafe sharing always seems like a terrible idea.
Is there a Better Way?
edit: forgot to mention, all business logic / data access is handled by a shared Business Layer project, so all the code for that is separate and shared.
Pack the shared code into a class library. That’ll take care of the data layer, business logic and some other auxiliary routines. My experience is that it helps a great deal with projects having the same foundation.
Your projects Red, Green and Blue, if they are different then they have to be kept apart. You can’t really circumvent that. My personal approach is to immediately introduce a change made in one into all others before you forget it. That has worked fine for me.