异步模块或处理程序已完成,而当时仍有异步操作处于未定状态

在写webapi的时候,出现"异步模块或处理程序已完成,而当时仍有异步操作处于未定状态"的问题,通过如下方式解决了。

<appSettings>
<!-- Allows throwaway async operations from MVC Controller actions -->
<add key="aspnet:AllowAsyncDuringSyncStages" value="true" />
</appSettings>

原文地址:https://www.cnblogs.com/fer-team/p/6519093.html