我在我的项目中使用 bit 框架,我想在 appstartup.cs 中添加 UseHttpsRedirection 作为中间件,我如何使用 bit 框架来做到这一点?
最佳答案
尝试使用这段代码:
dependencyManager.RegisterAspNetCoreMiddlewareUsing(aspNetCoreApp =>
{
AppEnvironment env = DefaultAppEnvironmentsProvider.Current.GetActiveAppEnvironment();
if (!env.DebugMode)
aspNetCoreApp.UseHttpsRedirection();
});
关于asp.net - 使用 Bit Framework 访问 IApplicationBuilder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57183287/