asp.net-core – ASP.NET Core 1.0 SynchronizationContext

前端之家收集整理的这篇文章主要介绍了asp.net-core – ASP.NET Core 1.0 SynchronizationContext前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
ASP.NET Core 1.0网站中的SynchronizationContext是否为null?
代码在我的系统上引发异常:
app.Use(async (context,next) =>
        {
            var sc = System.Threading.SynchronizationContext.Current;
            if (sc == null)
            {
                throw new Exception("SynchronizationContext is null");
            }

解决方法

它在ASP.NET 5中消失了,因为您不需要它的功能.它的全部目的是流动HttpContext.Current,它已经消失了.

I think it was also doing something with the current culture but I am not sure how that is handled now.

原文链接:https://www.f2er.com/netcore/247648.html

猜你在找的.NET Core相关文章