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");
}
Run Code Online (Sandbox Code Playgroud)
tug*_*erk 13
它在ASP.NET 5中消失了,因为您不需要它的功能.它的全部目的是流动HttpContext.Current,它已经消失了.
我认为这也与现有文化有关,但我不确定现在如何处理.
| 归档时间: |
|
| 查看次数: |
994 次 |
| 最近记录: |