- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试使用 app.UseHttpsRedirection() 方法时,它给我一个构建错误:
'IApplicationBuilder' does not contain a definition for 'UseHttpsRedirection' and no accessible extension method 'UseHttpsRedirection' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?
我尝试安装 Microsoft.AspNetCore.HttpsPolicy nuget 包。
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseAbp(); // Initializes ABP framework.
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
}
app.UseStaticFiles();
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseCookiePolicy();
app.UseHttpMethodOverride
app.UseJwtTokenMiddleware();
app.UseSignalR(routes =>
{
routes.MapHub<AbpCommonHub>("/signalr");
});
app.UseMvc(routes =>
{
routes.MapRoute(
name: "defaultWithArea",
template: "{area}/{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
最佳答案
UseHttpsRedirection 是一个隐藏在Microsoft.AspNetCore.HttpsPolicy
DLL。您必须添加它(通过 NuGet 或手动)
请参阅accepted answer here对于您可能需要的更多 DLL
关于aspnetboilerplate - Asp.net Core 2.2 app.UseHttpsRedirection() 未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57794929/
我不太明白 UseHsts 之间的区别和 UseHttpsRedirection在 .net core 中启动文件的配置部分。谁能解释一下? 最佳答案 根据文档,您应该同时使用两者: We recom
当我尝试使用 app.UseHttpsRedirection() 方法时,它给我一个构建错误: 'IApplicationBuilder' does not contain a definition
当我尝试使用 app.UseHttpsRedirection() 方法时,它给我一个构建错误: 'IApplicationBuilder' does not contain a definition
在 Startup.cs 文件中,考虑以下内容: public void ConfigureServices(IServiceCollection services) { // Irrelev
我将我的 asp.net core 2.1 WebApi 部署到 IIS 10。(IIS 作为代理) 我在 IIS 中添加了 SSL 证书并绑定(bind)了不安全端口 (8081) 和安全端口 (8
我是一名优秀的程序员,十分优秀!