Click here to Skip to main content
Click here to Skip to main content

Separating an ASP.NET Web Application into multiple Web Projects (Assemblies)

, 29 Aug 2004
Rate this:
Please Sign up or sign in to vote.
This article outlines how to separate an ASP.NET Web Application into multiple Web Projects (Assemblies).

Introduction

Sometimes, when a Web project is large and complicated, it is difficult to manage it as a single unit. Every small change in code requires recompiling of the whole unit and doing that is not so efficient. The solution is to separate a large Web project into multiple child projects and reference them from the main project. In this article, I will show how to implement this method.

Solution

Solution Explorer

First, let's create the main ASP.NET project in Visual Studio .NET. I will call it MainWeb. Then I will add two child projects:

  1. Child1 – C# ASP.NET project.
  2. Child2VB – VB.NET ASP.NET project.

In the location box of Add New Project dialog, we will type http://localhost/MainWeb/Child1 for Child1 and http://localhost/MainWeb/Child2VB for Child2VB.

The next step will be removing of global.asax and web.config from both child projects and reference them from the MainWeb project.

We almost have done. Now, we need to remove Child1 and ChildVB2 virtual directories from IIS.

That’s all.

Conclusion

Implementing this method on your projects has several advantages:

  • You will be able to write several parts of your Web project in different languages (C#, VB.NET…).
  • Doing some changes in code will not cause to recompiling of the whole assembly.
  • You will be able to separate a large project into logical units that will share common resources.
  • It is easier to maintain a small logical unit than a large one.

The disadvantages:

  • Visual Studio doesn’t support this method directly, so you have to make all these steps by your own.
  • Assemblies that access each other's resources must set references to each other. Visual Studio .NET does not allow circular references.
  • This solution is good only for large projects. Implementing this method on small Web applications is complex additional work.

This article is based on

How To Create an ASP.NET Application from Multiple Projects for Team Development.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Michael Kalika
Web Developer
Israel Israel
No Biography provided

Comments and Discussions

 
GeneralUsing Web.config from child projects PinmemberAndrusM3-Jun-09 8:55 
QuestionHow do we do this in ASP 2.0 PinmemberKarijn14-Oct-05 1:24 
GeneralThanks for the article PinmemberNayan S. Patel28-Aug-05 7:40 
GeneralAuthentication PinmemberEric Newton6-Nov-04 10:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 30 Aug 2004
Article Copyright 2004 by Michael Kalika
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid