So I recently installed Visual Studio 2017 and started it up. I selected “File” -> “New” -> Project. I wanted to create a basic ASP.NET web app just to see what the new IDE was looking like. I knew beforehand that I would be faced with basically two options up front, ASP.NET Web app using the full .NET framework or an ASP.NET Core Web app using the .NET Core framework and this was indeed the case.
After this initial choice I was faced with a much more complex set of options than I was not expecting and thought I would do up this post to try and help myself sort it out in my own head.
Picking “ASP.NET Web Application (.Net Framework)”
The reason most people will pick this type of application is because it will give you access to the whole suite of .NET Framework libraries, some of which are not available in .NET Core. It’s the way you have probably been building web apps in Visual Studio for years. It’s a mature framework that is used to build enterprise level, server-based apps on Windows. This type of web app will only run on Windows-based servers and cannot be deployed to Linux or MacOS. You will build your site using MVC, Web API, Signal R or old school Web Forms or Pages. It uses a Global.asax file to structure its startup output.
Here are your options for what to add to your base project template after you choose this type of project:
Picking “ASP.NET Core Web Application”
ASP.NET Core is open-source and cross-platform, its basically the old ASP.NET Web App rebuilt from the ground up. It’s perfect for building modern cloud-based web apps for Windows, Linux or MacOS. It provides a wwwroot folder, uses task runners and everything is through OWIN middleware using a Startup.cs file.
You would build your site using MVC, Web API or the new recommend way of Razor Pages – which are a little like old fashioned Web Form code-behind files mixed with MVC views.
Below are your options for what to add to your base project template after you choose this type of project. Note the drop-down in the top left corner. This is the point for me when things got a little hazy. I could not figure out why I would want to build a ASP.NET Core web app using the full .NET Framework, was this not defeating the purpose!? So lets look into this further…
ASP.NET Core Web app using .NET Core Framework vs .NET Framework
Some reasons I have found for building your ASP.NET Core Web Apps on the Full .NET Framework are:
- Better access to Nuget Packages – many Nuget packages have not yet been ported (or may never be ported) to run on .NET Core so if you run your app on .NET Core you may find yourself without some key Nuget package support.
- If you don’t need cross platform support – If you plan on running in Windows then you can safely just us the full .Net Framework with your ASP.NET Core web app
- You get the large performance boost that ASP.NET Core has over ASP.NET while still getting to access all the features of the full .NET Framework
Project Files look like this (ASP.NET Core MVC Web App using full .NET Framework)
Project Files look like this (ASP.NET Core MVC Web App using .NET Core)
Project Files look like this (ASP.NET MVC Web App using full .NET Framework)
Going through the 3 types of ASP.NET project I have one question – Why would I ever bother creating an ASP.NET standard web app on the full .Net Framework when I can run an ASP.NET Core web app on the full .Net Framework? The answer, after much research seems to be this, you shouldn’t! And here’s why:
The ASP.NET Web App project template with Full .Net Framework is the OLD, legacy way of doing ASP.NET Web apps. It is going to be phased out eventually, it’s only really there to support companies who need to support legacy applications and are not ready to take the jump to Core just yet. Core is the future. I recommend moving to Core now for any new projects and if you need to use the full .NET Framework then that’s fine, but be sure to combine it with the ASP.NET Core Web App template, not the standard.