Skip to main content

Posts

Showing posts from April, 2016

Consuming built MVC project under other MVC app

The idea is to reuse build application on multiple child application as a lot of Views and Codes need to be same on all children application. This approach can be a good candidate for a multitenant application, some sort of pluggable architecture or reusing MVC app as parent project.

There are three things need to be done to achieve.
Project built event to copy Views from the parent application.Area registration on child application.Custom View path through customized Razor view engine.Project built event to copy Views from the parent application.

This has to be configured on child application to copy from application build event. It can be done by going into project property => Build Events => Edit Post Built (Post-built event command line).
Ex:
xcopy "$(SolutionDir)"..\“App.Common\App.Common.Web\Views” “$(ProjectDir)\CommonAppLoc\Views\” /s /i /y /f

xcopy "$(SolutionDir)"..\“App.common\App.Common\App.Common.Web\Areas” “$(ProjectDir)\CommonAppLoc\Areas\” /s …