16

We want to split our large asp.net mvc web application into multiple Visual Studio projects so that each team can independently on their visual studio project.

Desired structure is:

  1. ASP.NET MVC application that is responsible for the base UI
  2. Module 1 - VS Project (Does this need to be a ASP.net MVC App or .dll?)
  3. Module 2 - VS Project (Does this need to be a ASP.net MVC App or .dll?)
  4. so on....

Each module should contain it's own controller & views that are responsible for functioning of the module. T

How to split the ASP.NET Application in to multiple projects and then merge them as a single website during build process?

7 Answers 7

8

ASP.NET MVC V2 has a feature called Areas which allows you to have separate projects referenced by the main application. Check out ScottGu's post.

Sign up to request clarification or add additional context in comments.

2 Comments

As far as I can tell, this is no longer supported in MVC3.
Areas are pain to manage if we have 100s of views in the site. Basically when we have 1000 of files loaded in Visual Studio, the build process sucks. It takes too long for build. So we divided our site into multiple asp.net projects and merged them in build process as I mentioned in the comment below: stackoverflow.com/questions/1200424/…
3

The problem is sorted out by just creating multiple MVC projects and merging the output at the end by simple copy & paste :)

here is the structure we followed:

  • MyApp.Web.Shell (just contains themes, css, js & images required for the web app)
  • MyApp.Web.Home
  • MyApp.Web.UserManagement
  • MyApp.Web.DeviceManagement
  • MyApp.Web.ContentManagement
  • .....etc...

At the end we are using build scripts to merge output of all the projects and generate the files required for the total web app to run.

If you need any help in implementing similar solution, get in touch with me at link text

Comments

2

One tool you may be interested in looking at is called ILMerge

This is a tool that will allow you to merge several .Net assemblies into a single DLL. It could be used to combine the output of your several projects into a single DLL for deployment.

I haven't ever tried it with Asp.Net MVC and I'm not familiar enough with the MVC architecture to say whether or not it will work for your situation. But it's likely worth a try.

Comments

1

Follow this link it will solve you problem.

Takes just 10 mins to complete the walk-through.

Walkthrough: Organizing an ASP.NET MVC Application by Logical Areas

1 Comment

This answer, unfortunately, is only valid for MVC 2 projects, which is still in a very early phase at the time of this writing.
0

One way we handled this in my previous job was to build a master 'controller' application. This app was deployed and was public facing. It's job was to read the incoming URL and, based on a bunch of mapping rules in config files, map that URL to other MVC applications running on the same server. This gave us lots of options such as being able to run the backing apps on different servers in the farm if we wanted to do crude load balancing. You need to manage things such as authentication across the multiple apps (if you're using authentication).

This basically gives you the ability to have as many different MVC apps as you need running on the servers all with the same front controller (essentially)

Comments

0

You could just use good Source Control and have the respective teams check out what they need to work on.

This way you have only one dll at compile time...

Comments

-1

If your app doesn't require areas, and your goal is just to allow team independence, why not just use a better source code control system? Unless you have truly independent modules, sounds like managing via branches in subversion is appropriate.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.