AspNetSynchronizationContext and await continuations in ASP.NET
I noticed an unexpected (and I’d say, a redundant) thread switch after await inside asynchronous ASP.NET Web API controller method.
I noticed an unexpected (and I’d say, a redundant) thread switch after await inside asynchronous ASP.NET Web API controller method.
The only override I see exposed on MVC’s AuthorizeAttribute is public override void OnAuthorization( AuthorizationContext filterContext ) which is not suitable for use with async/await because it doesn’t return a Task. Is there another way to create an AuthorizeAttribute in MVC that allows the use of async/await?
I’m having difficulty understanding the mechanics behind ExecutionContext. From what I’ve read online, context-sensitive items such as security (Thread Principal), culture, etc, should flow across asynchronous threads within the bounds of an execution unit of work. I’m encountering very confusing and potentially dangerous bugs though. I’m noticing my thread’s CurrentPrincipal is getting lost across async … Read more
I am building a set of ASP.Net hosted WebAPI services that must use an old library which depends heavily on HttpContext.Current. I am having trouble ensuring that context is preserved in all the methods that participate in an async call. I have tried several variations with await/Task.Wait and TaskScheduler.FromCurrentSynchronizationContext() on the below code.
I was doing some coding in ASP.NET when I came across this:
I need to call a method returning a Task from within
I’m hitting deadlock even after using ConfigureAwait(false), below is the sample code.
I’ve written a custom ASP.NET control and I just updated it to have an async Load event handler. Now I’m getting this error:
What is the benefit of using async with the ASP.NET QueueBackgroundWorkItem method?
I have a method in ASP.NET application, that consumes quite a lot of time to complete. A call to this method might occur up to 3 times during one user request, depending on the cache state and parameters that user provides. Each call takes about 1-2 seconds to complete. The method itself is synchronous call to the service and there is no possibility to override the implementation.
So the synchronous call to the service looks something like the following: