zoukankan      html  css  js  c++  java
  • 错误详情:已取消该操作。--------- 在 System.Threading.CancellationToken.ThrowOperationCanceledException()

    错误详情:已取消该操作。--------- 在 System.Threading.CancellationToken.ThrowOperationCanceledException()
    在 System.Net.Http.HttpContentExtensions.<ReadAsAsyncCore>d__0`1.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
    在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    在 System.Web.Http.ModelBinding.FormatterParameterBinding.<ExecuteBindingAsyncCore>d__0.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
    在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    在 System.Web.Http.Controllers.HttpActionBinding.<ExecuteBindingAsyncCore>d__0.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
    在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    在 System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
    在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    在 System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
    

      

    尝试如下操作:
    config.MessageHandlers.Add(new CancelledTaskBugWorkaroundMessageHandler());

    class CancelledTaskBugWorkaroundMessageHandler : DelegatingHandler
    {
    protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    {
    HttpResponseMessage response = await base.SendAsync(request, cancellationToken);

        // Try to suppress response content when the cancellation token has fired; ASP.NET will log to the Application event log if there's content in this case.
        if (cancellationToken.IsCancellationRequested)
        {
            return new HttpResponseMessage(HttpStatusCode.InternalServerError);
        }
    
        return response;
    }

    }

  • 相关阅读:
    linux高级编程day14 笔记
    [转]ubuntu下gcc的安装与使用
    MySQL主从复制(Replication for Backup)
    Zabbix(2,添加主机,监控项)
    jumpserver for C7一步一步安装
    MySQL:创建、修改和删除表
    NOT EXISTS替代NOT IN 和 EXISTS替换DISTINCT 识别‘低效执行’的SQL语句
    ie6、ie7下JSON.parse JSON未定义的解决方法
    CentOS6.4编译源码安装mysql5.0.41
    获取客户端IP并判断内外网
  • 原文地址:https://www.cnblogs.com/shy1766IT/p/11469675.html
Copyright © 2011-2022 走看看