asp.net mvc 4 async controller hanging on none TaskAsync methods

后端 未结 1 941
故里飘歌
故里飘歌 2021-01-24 11:34

I\'m using Visual Studio 2011 Beta with 4.5 Beta. There seems to be a bug with ASP.Net MVC 4, where if the method returns a none \"TaskAsync\" task, it hangs the request.

<
1条回答
  •  情书的邮戳
    2021-01-24 12:15

    Known issue with MVC 4 Beta.

    In short, add the following to ~/Web.config:

       
         
       
    

    Then add await Task.Yield(); as the first line in your action method. (Don't forget the await!)

    0 讨论(0)
提交回复
热议问题