ASP.NET Core 2.0 Released
I’m very excited that the v2 of ASP.NET Core is now released. Married with Visual Studio 2017 Update 3 (or VS Core), it is now a maturing platform.
I really like what the team has been doing since the release of 1.0. They seem to really have thought about the pain points of the initial versions and worked to eliminate as many as they could.
Of course v1.x was a bumpy time. The migration from project.json to MSBuild was a painful one, but we’re past that now. You can get it now from the dot.net website:
I wanted to point out some of my favorite changes in version 2.0:
.NET Standard 2.0: Moving to a standard surface area for .NET means that we can write libraries that work across the .NET Ecosystem even easier.
Unified ASP.NET Core Reference: Instead of adding an assembly reference for every small subsystem, v2 includes Microsoft.AspNetCore.All which is the master package for all of ASP.NET Core. Through some magic, it only uses the assemblies you actually use in your code. Love it.
WebHost.CreateDefaultBuilder(): Instead of relying on boilerplate to create a webhost with the default options, we now have this tight, overrideable class.
Moving Startup Services to WebHost: Part of the use of CreateDefaultBuilder is automatically enlisting logging and configuration earlier than the Startup class. This way you can take advantage of them as early as you might need them.
Razor Pages: Creating controllers and views for one-off or single page sites always seemed a little odd. While they’re not perfect, I think Razor Pages are a great first attempt at a compromise between full MVC and simple code.
Full .NET Assembly Support: If you’re already building full .NET assemblies that contain code you need to share between ASP.NET and Core, you’re in luck. With v2, you can now reference a full .NET assembly in .NET Core.
Consistent Middleware Configuration: In v1.x, the way that different Microsoft middleware was configured was confusing and non-standard. Some would be configured in Configure, some in ConfigureServices, some took options, some took a lambda. That’s all changed, most of the middleware now use discoverable ways to configure them.
Get your hands dirty and dig into ASP.NET Core 2.0. I think you’ll find it’s ready for prime time. I’m even updating my Pluralsight course to 2.0 as we speak. I’ll let you know when it’s ready!