首页 > Web开发 > 详细

net core 3 报An unhandled exception occurred while processing the request错误

时间:2020-06-30 10:52:33      阅读:402      评论:0      收藏:0      [点我收藏+]

使用net core 开发时报以下错误

An unhandled exception occurred while processing the request.

Exception: Correlation failed.

Unknown location

Exception: An error was encountered while handling the remote login.

Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler<TOptions>.HandleRequestAsync()

看了一下后台错误原因,貌似是cookies没有存储上,然后就想到了net core 3 生成的项目模板默认实现了<<通用数据保护条例>>,所以设置存储Cookie需要做一些处理。

1.第一种是在Startup的ConfigureServices方法中关闭这个支持.(我使用的此方法解决了以上问题)

services.Configure<CookiePolicyOptions>(option => {
                option.CheckConsentNeeded = context => false;
            });

2.设置存储的Cookie为重要(未实际试验)

 this.Response.Cookies.Append("stdio", DateTime.Now.ToString(), new CookieOptions {
                IsEssential = true
            });

 参考文章:https://www.cnblogs.com/zzr-stdio/p/10617532.html

net core 3 报An unhandled exception occurred while processing the request错误

原文:https://www.cnblogs.com/acore/p/13212089.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!