Oskar
Oskar

Reputation: 333

Multiple web applications projects within a visual studio solution

I am currently starting the development of a new website using ASP.Net Webforms. To give this project a proper start I am investigating a visual studio solution setup for the application, where I want my application to consist of easily recognizable components that are equal in size (lines of code).

Since the project is hasn’t actually started yet I have structured the solution in a standard three tier setup (data, business logic and presentation). This setup is fine at the start of the project but as the project grows the three tiers will soon start to become big and navigating and finding code will become harder which will hurt maintainability and overall feel of quality.

So during the project I want to convert to a new setup where I form functional components that each has their own three tier setup. For example: the website has a shopping cart and options to create and manage a user account. There should also be component for stull used across multiple components, which I will call common for this example. That would lead to the following setup:

The common files:

The shopping cart:

The account management:

The website:

The sample above has three components that each contains three projects. Each component has one web application project that contains web files (pages, controls, front-end code). All my previous .Net project all had a simple web application project, so this setup is a new experience for me.

I still want the solution to feel as one application, being able to debug the website and the components with ease. To achieve this I assume the “Project.Web.Presentation” web application project should be the main web application project. I am currently investigating if it is possible to setup a solution this way, I have tried several approaches but none have worked well so far:

So far I haven’t found a good way to work with setup I have in mind. I am open to suggestions, thanks in advance for the tips!

Upvotes: 2

Views: 6423

Answers (1)

IrishChieftain
IrishChieftain

Reputation: 15253

I'm working on something similar and decided to use NuGet to push out all the common parts:

Multi-Project Nuget Issues

Updating Files in Existing Nuget Package

Visual Studio Multi-Project Solution Options

The only other way to do this involves nested master pages and post build scripts - messy.

Upvotes: 2

Related Questions