Introduction
We have recently moved our ASP.NET ZERO solution from ASP.NET MVC 5.2.3 to ASP.NET Core 1.0. In this post, I will share my experiences and explain mechanics of this migration in brief.
Notice that: I didn’t convert the solution to .NET Core, I just moved to ASP.NET Core on top of full .NET Framework 4.6.1.
Solution Structure
I decided to use new .xproj/project.json format instead of old .csproj format for the solution. Although Microsoft announced that .xproj/project.json format will also be changed and returning back to the .csproj format, actually new .csproj format will be different than the old one. So, I decided to use the latest format (as Microsoft also does the same for ASP.NET Core platform) and migrate to the new .csproj format when the time comes.
There are pros and cons of project.json format, but I will not go to all details. The most big problem is it’s not well documented yet. I found some partial documents/articles and most of them was out-dated. So, “try and see” approach was my best friend in some cases.
Old solution structure was like that:
New solution structure is shown below:
.WebApi project has gone and solution is seperated to src & test folders (default convention for new solution structure).
Obviously, I created a new solution and empty projects inside it. Then copied all files into this solution manually. All layers (including test project) except the Web layer are successfully compiled in new project format without any change.
Nuget Packages
After moving code to new solution folder, I also added needed nuget package references to project.json. For example, my project.json file for new .Core project is like that:
{
"