Profile picture
David Fowler @davidfowl
, 12 tweets, 6 min read Read on Twitter
Ok tweeting about some hidden gems in the release that people may not know about. #aspnetcore #dotentcore
First, the generic host docs.microsoft.com/en-us/aspnet/c…. We like the hosting model of ASP.NET Core and think it should exist in more application types. #dotnetcore #aspnetcore
Next, IHostedService. A way to run long running background operations in both the generic host and in your web hosted applications. docs.microsoft.com/en-us/aspnet/c…. 2.1 added support for a BackgroundService base class that makes it trivial to write a long running async loop.
Next, Windows services now work on .NET Core nuget.org/packages/Micro…. The docs are being updated docs.microsoft.com/en-us/aspnet/c… (it still says .NET Framework only)
Next, there's a feature called IHostingStartup that lets you configure the IWebHostBuilder by specifying an assembly attribute github.com/aspnet/Hosting…
Next, it's possible to build packages that are used as helpers to share source code. We internally call these "shared source packages". We use them all over the ASP.NET Core code base for things we don't want to expose public APIs for github.com/aspnet/Common/….
We consume them like this:
github.com/aspnet/SignalR…

Notice they never end up in the actual dependencies of the resulting package:
nuget.org/packages/Micro…
Next, If you ever need to invoke a method on a type via reflection and that method could be async, we have a helper that we use everywhere in the ASP.NET Core code base that is highly optimized and flexible. The ObjectMethodExecutor github.com/aspnet/Common/…
We use this code in MVC to invoke your controller methods. We use this code in SignalR to invoke your hub methods. It handles async and sync methods. It also handles custom awaitables and F# async workflows
Next, a small and commonly requested one. If you hate the output that dotnet run gives when you host a web application (printing out the binding information) you can use the new SuppressStatusMessages extension method. #dotnetcore #aspnetcore
Next one comes from the @msftorleans team. We made it easier in 2.1 to configure options that require services. Previously, you would have had to create a type that derived from IConfigureOptions<TOptions>, now you can do it all in ConfigureServices via AddOptions<TOptions>
Next, as much as it pains me, we made it easier to register the IHttpContextAccesor via the AddHttpContextAccessor method. Thanks @khellang!
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to David Fowler
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($3.00/month or $30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!