Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Star
7702 Points
1099 Posts
Microsoft
Mar 16, 2012 04:09 AM|LINK
To work around this issue for the Beta, do two things. First, add the following to your ~/Web.config if it is not already there:
<appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings>
Second, add this as the first line within your Task-returning action method:
await Task.Yield();
The second part (the 'await Task.Yield();') will not be necessary once this bug is fixed post-Beta.
Hope this helps!
levib
Star
7702 Points
1099 Posts
Microsoft
Re: Using an Async Action to Run Synchronous Code
Mar 16, 2012 04:09 AM|LINK
To work around this issue for the Beta, do two things. First, add the following to your ~/Web.config if it is not already there:
<appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings>Second, add this as the first line within your Task-returning action method:
The second part (the 'await Task.Yield();') will not be necessary once this bug is fixed post-Beta.
Hope this helps!