Hello, ASP.NET Core 2.1

UPDATE, 2018 May 30: It’s alive. The dotnet team officially announces 2.1 on their blog!

The newest version of ASP.NET Core will be released in just a few days, the team announced this week. They’re targeting Wednesday, May 30, 2018, with an early-access release available already. I’m excited about many of the new features in this release, but I’ve highlighted a few favorites below.

The Return of SignalR!

If you’ve been developing in ASP.NET for very long at all, you’re probably already familiar with SignalR, but in case you’re not, it’s ASP.NET’s framework for pushing messages out over web sockets. It easily allows developers to create live-updating applications which receive data that is pushed from the server into the browser. Since its launch, ASP.NET Core has been missing this feature, but now it’s back, and better than ever. Its return sees many familiar classes and conventions, but the library has been heavily rewritten to improve things such as performance.
Microsoft recently announce SignalR as a service on Azure at their Build conference, which is built on ASP.NET Core’s implementation of SignalR. If you want to be able to scale your SignalR implementation up and down, it doesn’t get any easier than this!

APIController Attribute

In ASP.NET Core, Microsoft has merged what used to be MVC and Web API into a single, consistent framework. Anywhere that saw a difference between the two, the victory usually went to MVC. Because of that, there are a few things about creating API controllers in ASP.NET Core that feel a little wordy. Specifically, you have to mark up your code with a large number of attributes to get it to work the way you want.
Version 2.1 introductions the APIController Attribute. You can mark up your API controller class (or a base class) with this attribute just once, and get’s lot’s of API controller conventions applied to your class automatically. For example, now complex parameters types will be assumed to come from body without the FromBody attribute being specified, and more simple types will be assumed to come from the path without the FromUri. The action methods will also automatically check your ModelState to see if it’s valid, and returns a 400 message if it’s not.
A new generic return type has also been introduced, called ActionResult<T>. You no longer have to document your code with an attribute to tell things like OpenAPI (formerly know as Swagger) what type a method will return. The type you specify as the subtype of ActionResult<T> will be the documented return type, but you can still return other HTTP responses when you want to.
Finally, any JSON parsing errors will now give you error messages with more information about the mismatch to help you debug your code.

New Project Templates

I’m really excited the there is now a project template for Angular applications that are Angular CLI-friendly, as well as other SPA templates hosted in ASP.NET Core. New project templates will also include General Data Protection Regulation (GDPR) implementations by default.

Razor Class Libraries

Have you ever noticed that adding ASP.NET Identity to a project adds A LOT of files, including a bunch of default razor views? By now allowing razor pages to be compiled into assemblies and packages, Microsoft has allowed us to bring complex pre-built views like these into our applications, just by making a reference or bringing in a Nuget package.
ASP.NET Core applications will now find views in referenced assemblies in addition to the standard view folders where that they’ve always looked. That means you can use all the views provided by a library, but override just one of them to be different in your application. OO comes to views!

ASP.NET Core Identity

Along with the changes listed above, ASP.NET Core Identity comes with a new scaffolder that will make it much easier to add ASP.NET Core Identity to an existing project. In the past, this was only really possible in a new project. If you wanted to add it to an existing one, it was a significant amount of manual work. No longer!

HTTPS by Default

From now on, ASP.NET Core appliation templates will have HTTPS turned on by default. Microsoft has included a new HTTPS redirection middleware to allow you to intelligently redirect all traffic from an HTTP page to an HTTPS one.
Indeed, Kestrel will listen on both port 5000 (HTTP) and port 5001 (HTTPS) by default for debugging sessions, and you will have a certificate installed on your machine when you install the 2.1 SDK. If you want to work with dev certificates yourself, Microsoft has included a dev-certs tool in the CLI.

HTTPClient and HTTPClientFactory

Apparently we developers kind of suck as using HTTPClient correctly. We create to many of them, for one thing, and they can eat up all the sockets on our machines, greatly impacting performance. HTTPClientFactory comes to the rescue by handling HTTPClient lifetimes for us.
Oh, and it’s also worth pointing out that the new HTTPClient has been now rewritten and is as mach as 10 times faster than in was before!

Razor Page Improvements

I haven’t really gotten into using Razor Pages instead of MVC very much, but the ASP.NET team has put a lot of effort into this feature recently. If you’re not familiar with it yet, I might describe it as a mashup of the best things about Web Forms and MVC, with less of the bad parts of each. ASP.NET Core 2.1 sees several nice improvements to this pattern.

ASP.NET WebHooks

The core of ASP.NET WebHooks receivers has now been ported into ASP.NET Core, allowing you to easily implement WebHooks. WebHookes are a simple way of sharing event notifications across different sites and services on the internet.

Virtual authentication schemes

If you wanted to use different authentication schemes in different situations, that was difficult before in ASP.NET Core, but now it allows you to specify a “vitual” scheme as your authentication scheme. Within the virtual scheme, you can create your own logic based on anything you want to resolve to an actual authentication scheme.

Kestrel

Microsoft added a socket transport layer that you can use instead of the libuv layer that’s been there up until now. They warn that this isn’t quite ready for prime time yet, but that they think it has the potential to really improve the performance of ASP.NET Core applications even more.

Microsoft.AspNetCore.App Nuget Meta-Package

This package differs from the existing Microsoft.AspNetCore.All meta-package in its reduced dependency on packages not owned or supported my Microsoft and includes just the minimum to make sure all the major framework features work. Think of this as “Microsoft.AspNetCore.Min”, where you can add any of the non-essentials pieces individually as needed.
If you’re interest in learning more about these new features, check out The ASP.NET teams blog post about it.

Related Blog Posts

We hope you’ve found this to be helpful and are walking away with some new, useful insights. If you want to learn more, here are a couple of related articles that others also usually find to be interesting:

Our Gear Is Packed and We're Excited to Explore with You

Ready to come with us? 

Together, we can map your company’s tech journey and start down the trails. If you’re set to take the first step, simply fill out the form below. We’ll be in touch – and you’ll have a partner who cares about you and your company. 

We can’t wait to hear from you! 

This field is for validation purposes and should be left unchanged.

Together, we can map your company’s tech journey and start down the trails. If you’re set to take the first step, simply fill out the form below. We’ll be in touch – and you’ll have a partner who cares about you and your company. 

We can’t wait to hear from you! 

Montage Portal

Montage Furniture Services provides furniture protection plans and claims processing services to a wide selection of furniture retailers and consumers.

Project Background

Montage was looking to build a new web portal for both Retailers and Consumers, which would integrate with Dynamics CRM and other legacy systems. The portal needed to be multi tenant and support branding and configuration for different Retailers. Trailhead architected the new Montage Platform, including the Portal and all of it’s back end integrations, did the UI/UX and then delivered the new system, along with enhancements to DevOps and processes.

Logistics

We’ve logged countless miles exploring the tech world. In doing so, we gained the experience that enables us to deliver your unique software and systems architecture needs. Our team of seasoned tech vets can provide you with:

Custom App and Software Development

We collaborate with you throughout the entire process because your customized tech should fit your needs, not just those of other clients.

Cloud and Mobile Applications

The modern world demands versatile technology, and this is exactly what your mobile and cloud-based apps will give you.

User Experience and Interface (UX/UI) Design

We want your end users to have optimal experiences with tech that is highly intuitive and responsive.

DevOps

This combination of Agile software development and IT operations provides you with high-quality software at reduced cost, time, and risk.

Trailhead stepped into a challenging project – building our new web architecture and redeveloping our portals at the same time the business was migrating from a legacy system to our new CRM solution. They were able to not only significantly improve our web development architecture but our development and deployment processes as well as the functionality and performance of our portals. The feedback from customers has been overwhelmingly positive. Trailhead has proven themselves to be a valuable partner.

– BOB DOERKSEN, Vice President of Technology Services
at Montage Furniture Services

Technologies Used

When you hit the trails, it is essential to bring appropriate gear. The same holds true for your digital technology needs. That’s why Trailhead builds custom solutions on trusted platforms like .NET, Angular, React, and Xamarin.

Expertise

We partner with businesses who need intuitive custom software, responsive mobile applications, and advanced cloud technologies. And our extensive experience in the tech field allows us to help you map out the right path for all your digital technology needs.

  • Project Management
  • Architecture
  • Web App Development
  • Cloud Development
  • DevOps
  • Process Improvements
  • Legacy System Integration
  • UI Design
  • Manual QA
  • Back end/API/Database development

We partner with businesses who need intuitive custom software, responsive mobile applications, and advanced cloud technologies. And our extensive experience in the tech field allows us to help you map out the right path for all your digital technology needs.

Our Gear Is Packed and We're Excited to Explore with You

Ready to come with us? 

Together, we can map your company’s tech journey and start down the trails. If you’re set to take the first step, simply fill out the contact form. We’ll be in touch – and you’ll have a partner who cares about you and your company. 

We can’t wait to hear from you! 

This field is for validation purposes and should be left unchanged.

Thank you message.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.