c# - UseTaskFriendlySynchronizationContext with WebForms and WebAPI in the same project -


i have legacy app uses webforms need extend. incorporated webapi newer functionality . works great until start using async await.

in webapi usetaskfriendlysynchronizationcontext = false cause httpcontext null. setting true fixes issue.

in webforms usetaskfriendlysynchronizationcontext = true causes pages never return. it's iis never returns response. setting false fixes this.

is there someway have true webapi , false webforms?

no, it's not possible have set @ level. asp.net runtime in process (technically app-domain) must use 1 implementation.

my recommendation investigate webforms code , determine why deadlocking new syncctx. vast majority of code should work fine, there must unusual there.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -