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
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:
- Child1 � C# ASP.NET project.
- 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.