9

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?)

1 Answer 1

19

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Addition: You have to add "Microsoft.AspNetCore.Server.Kestrel.Https" to your project.json to see UseHttps()

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.