更新时间:2023-12-03 18:54:46
您还必须设置 HttpContext.Current.User
.请参阅此答案 和 这篇博文 了解更多信息.
You have to set HttpContext.Current.User
as well. See this answer and this blog post for more info.
更新:还要确保您在 .NET 4.5 上运行并将 UserTaskFriendlySynchronizationContext
设置为 true
.
Update: Also ensure you are running on .NET 4.5 and have UserTaskFriendlySynchronizationContext
set to true
.