I want to run Kestrel on https with asp.net core 1.0 I tried to follow this post http://dotnetthoughts.net/how-to-setup-https-on-kestrel/
But it doesn't work with asp.net core
It is giving the error at
app.UseKestrelHttps(certificate)
The error is
Error CS1061 'IApplicationBuilder' does not contain a definition for 'UseKestrelHttps' and no extension method 'UseKestrelHttps' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)
Kestrel is a cross-platform web server for ASP.NET Core. Kestrel is the web server that's included by default in ASP.NET Core project templates. Kestrel is supported on all platforms and versions that .NET Core supports.
Configuring HTTPS for Kestrel. Kestrel is the web server that is used by default with ASP.NET Core. To add HTTPS support to Kestrel add the Microsoft.AspNetCore.Server.Kestrel.Https package as a dependency.
If you are running Windows and have the full version of Visual Studio you can just do File -> New Project, select .Net Core, ASP.NET Core Web Application and then select Empty. Kestrel is the web server that is used by default with ASP.NET Core.
In this article. Kestrel is a cross-platform web server for ASP.NET Core. Kestrel is the web server that's included and enabled by default in ASP.NET Core project templates. †HTTP/2 will be supported on macOS in a future release. Kestrel is supported on all platforms and versions that .NET Core supports.
That article seems to be about ASP.NET 5 RC1. According to this post, in ASP.NET Core, .UseKestrelHttps()
has been replaced with options.UseHttps()
, for example:
var host = new WebHostBuilder()
.UseKestrel(options => {
options.UseHttps(new X509Certificate2(...));
})
You need to add Microsoft.AspNetCore.Server.Kestrel.Https
to your project to get the UseHttps
functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With