The WebListener server is a Windows-only server that can be used to run ASP.NET Core applications.
- [Narrator] Another item in 1.1 is the WebListener server for windows. Now this runs on top of Windows Http.Sys kernel and it doesn't rely on IIS. In fact, it doesn't even work with IIS. But it's used to take advantage of specific windows features that you might need, such as windows authentication, port-sharing, https with SNI, and much more. It requires the Miscrosoft.AspNetCore.Server.WebListener package, and what is a little unique is that this package was shipped as a 1.0 and a 1.1 release, so even though it's a new feature in 1.1 they made it backwards compatible for 1.0.
There's way too much information about the WebListener server to cover in this brief segment, so much more information can be found in the docs including limitations and running with SSL and lots of other options. And the WebListener server has changed to Http.Sys in 2.0 and there's expanded options, and we will certainly cover that in the ASP.NET 2.0 chapter. So let's look at the changes we have to make to run.
First and foremost I created a new section here in the launchsettings.json. I could have used a SpyStore setting starting on line 18, but I just made a new one on line 26. The environment is still development. I did add a different port so I would know specifically that I'm running under the WebListener, but other than that you can see that the settings are the same. So let me close the start up and open up the program so we can get into where we need to be, and I've refactored this a bit since the 1.0 demo.
I've separated out the RunKestrelAndIisNoSsl. If you want to go through and run SSL you can use this one instead. We're going to go ahead and comment this out and uncomment the RunWebListener and let's look at that method. So you can see there's no IIS and no kestrel in here. I'm using pretty much the default settings although you have to set them. So the options are there's no authentication scheme and I'm allowing anonymous, and the UseContentRoot, UseStartup, ApplicationInsights, those are all consistent across them all.
So when I run this, I just do the drop down to WebListener demo, and then when I run it, it will just run under WebListener. So let's prove that it actually works. And we have our application running on 63814 and also you can see that it is firing up a command line very similar to how kestrel runs but it's not using kestrel, it's using the WebListener server.
- Running and debugging ASP.NET Core applications
- Pros and cons of migrating existing applications to ASP.NET Core.
- Built-in dependency injection
- Environment awareness and app configuration
- Web host configuration and SSL
- View components invoked as tag helpers
- Configuration and logging
- Using Razor Pages