Tutorial :Appropriate VS Project for Multiple .Net Sites


Here's what I'm working with:

  • Several websites
  • Classes/data shared between them (registration systems on individual sites, and management on a central site)
  • A workflow application that runs nightly.

I need to be able to cleanly and easily share the classes between the websites and workflow component. I know this is textbook 'DLL!', but I'm wondering what kind of Visual Studio (2008) project(s) you recommend to make all this happen in a clean, logical fashion.

What do you suggest?

Edit: I seem to remember some kind of project type (in VS05?) that allowed me to contain several sites and projects (all related) in the same solution. Am I nuts?


this is sort of a no brainer, unless I am missing something in your question.

You would have a website project for each website, and a class library project for your dll.

But what I THINK you meant is how to easily share the DLL(s) across all sites? In that case try coding some post build events for the DLL to deploy it to all appropriate BIN folders


A whole other way to share the code between the websites is though webservices that run locally, and closed for outsiders to see. That way, you share functionality, but only have one update point for the logic - but then again, this make it hard to upgrade your code, as you need to make sure, that none of your websites will break, when chaning code, and fix bugs etc.

For multiple sites in one solution, then yes. You can have milions of website projects in the same solution. There are two website options: Website and Web Application.


Create a bland solution first.

Then add site 1, 2, 3.... to the solution as you need.

Add the workflow project to the solution

Add a Class library project to the solution.

Reference the Class library project in all of other projects.


Here was the problem I was running into. In Visual Studio 2008, the Solution View is hidden by default, making it hard to add other projects, websites, etc.

Enabling the Solution View solved all of my problems.


There seems to be some ambiguity in our terminology here. We are presuming that when jcelgin posed the question, he was referring to the Website (or Web site) template. If this is the case, then he is going to encounter difficulties sharing the library. Are the sites actually based on the Web Application Project template? If so, then it should be straightforward...

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »