We have MVC ASP.NET Web Applications written within the ASP.NET 4.* scope that we would like to phase across to ASP.NET 5. While we transition (as well as client-side JavaScript scripts/libraries, CSS, etc) we'd like the old app (which obviously contains Views, Controllers, Helpers, Utilities, Attributes, etc) to co-exist in an MVC/Web-Application ASP.NET 5 project, with the new (ASP.NET 5) codebase.
Firstly is this possible with minimal changes ? I have been doing some testing and a lot of reading - for the client-side libraries I should be able to handle the co-existence by copying the existing content into the wwwroot area via Gulp. My question is mostly around the server-side artifacts - for example I am using a framework (as specified in project.json) of "dnx46" (which seems to be the most appropriate for this purpose), but I am getting a number of conflicts (around missing assemblies) around simple things like Project references, ActionFilterAttribute & AuthorizeAttribute [eg. The type or namespace name 'AuthorizeAttribute' does not exist in the namespace 'System.Web.Mvc' (are you missing an assembly reference?)] (because they no longer exist in the System.Web.Mvc namespace), HttpContextBase, security (OWIN, etc) etc - note that I'm aware of including References which are reflected within the project.json file (and some that finish up inside the appropriate 'wrap' folder location)
If there is a preferred approach - some possibilities are
- create a new WebApplication ASP.NET 5 project which among other things contains out of the box Bower, npm, Gulp, CodeFirst Migrations, Controller/Views, etc ready to go then copy your legacy project artefacts in
- create a blank ASP.NET 5 project and start everything from the ground up (as per http://aspnetmvc.readthedocs.org/projects/mvc/en/latest/migration/migratingfrommvc5.html) then again copy your legacy project artefacts in
- create a new WebApplication ASP.NET 5 project, then with a post-build event copy your new and legacy artifacts into a third vanilla project. In this way the old and new projects live in isolation and only get merged in at deployment time
- separate concerns like Helpers, Utilities, Attributes, etc that are used within the UI project into a traditional Class Library project and only keep the bare minimum (Views, Controller, scripts, css, etc) within the UI (ASP.NET 5) project
Any ideas would be greatly appreciated.