在asp.net core 5中,Request.Schema已经被Request.Protocol取代。如果需要使用Schema属性,需要导入以下命名空间:
using Microsoft.AspNetCore.Http;
然后使用以下代码:
string schema = this.Request.Scheme;
上一篇:ASP.NETCore5中找不到构造函数。
下一篇:ASP.NETCore5中,使用RenderRazorViewTostring方法无法在PartialView中嵌套多个PartialAsync。