Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How do asp.net core razor pages use ssl ?

$
0
0

<div>By Rick Anderson 's  article
'Enforce HTTPS in an ASP.NET Core'  https://docs.microsoft.com/en-us/aspnet/core/security/enforcing-ssl</div> <div>
// Requires using Microsoft.AspNetCore.Mvc;

public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
       services.Configure<MvcOptions>(options =>
    {
        options.Filters.Add(new RequireHttpsAttribute());
    });
        }

My question is   asp.net core razor pages use ssl    can  use  The preceding highlighted code ?

I run my program in loacal host  ,it is   Ok;

But   run  the program in  IIS   it is  "no page is found ",

I  don't  know  why?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>