Saurabh Palatkar Saurabh Palatkar - 1 month ago 20
ASP.NET (C#) Question

How to Deploy asp.net mvc 4 application having multiple Areas

I followed this article to make the pluggable asp.net mvc4 applicaton

But facing problem while deploying the application. In my solution MainProj is the main project, where as all the other projects are in the area folder. Each of the project have its model, view and controller. I have given references of all the sub projects (projects in area folder) in the MainProj. Now when trying to deploy MainProj, Its only publishing the main project with its views (in this case MainProj), the projects in the area folder are not deploying (ex: Cart, CRM). Even if I add references of the projects in area (ex CRM) in the main projects(MainProj), only the ddl of the projects in area(ex CRM) get deployed in bin folder, no views of the project in areas(CRM) getting deployed. Whats going wrong.

Here is the structure of solution:

enter image description here

Here is my original folder structure.

enter image description here

However when I run my project in debug mode within visual studio, the app is running perfectly fine. So I clicked on the iis express icon in the system tray at bottom of screen and observed that visual studio is hosting different sites for each project.

enter image description here

Somewhat similar answer found here but not working in my case.
Please let me know what I am missing or doing wrong. What is the correct way to deploy such application.
Thanks in advance.

Answer

Finally solved the issue. Added references of all the projects within the solution into the MainProj. Then first deployed the main project (MainProj) in publish folder. So the directory becomes as follows:

  • Publish
    • MainProj

Then manually created folder "Areas" In publish folder

  • Publish
    • MainProj
    • Areas

Then manually created folder for each project in the area within "Areas" folder:

  • Publish
    • MainProj
    • Areas
      • Cart
      • CRM
      • ....
      • ....
      • Admin
      • customer
      • StoreFront

Finally manually deployed (published) each sub project (projects within area) within their respective folders one by one. Ex. CRM is deployed in CRM folder.

Thats it.... My app is working exactly fine.

Created publish profile for each project, now I can just deploy any of the project to their respective location at any time, enabling each developer to work independently on any individual project and deploy their project (module) to the publish environment to specified location without any dependency.