{"id":6185,"date":"2017-03-07T16:00:00","date_gmt":"2017-03-07T16:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/?p=6185"},"modified":"2019-02-14T20:23:57","modified_gmt":"2019-02-15T03:23:57","slug":"an-alternative-to-configureawaitfalse-everywhere","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/an-alternative-to-configureawaitfalse-everywhere\/","title":{"rendered":"An alternative to ConfigureAwait(false) everywhere"},"content":{"rendered":"<p>In his latest blog post, Premier Developer consultant <a href=\"https:\/\/social.msdn.microsoft.com\/profile\/BenWilli\" target=\"_blank\">Ben Williams<\/a> brings us this article on asynchronous code.<\/p>\n<hr>\n<p> One of the general recommendations you may often read is to use ConfigureAwait(false) in library code. This is so that when the library is used, it does not block the synchronization context in use by the application (e.g. the UI thread). If the library doesn\u2019t know anything about the app, it doesn\u2019t depend on the application\u2019s context and doesn\u2019t need to run within it. This makes sense but it ends up truly meaning that you have to put ConfigureAwait(false) on every async call in your entire library. To me, that seems \u2026excessive.<\/p>\n<p><a href=\"https:\/\/blogs.msdn.microsoft.com\/benwilli\/2017\/02\/09\/an-alternative-to-configureawaitfalse-everywhere\/\" target=\"_blank\">Read more on Ben\u2019s blog\u2026<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In his latest blog post, Premier Developer consultant Ben Williams brings us this article on asynchronous code. One of the general recommendations you may often read is to use ConfigureAwait(false) in library code. This is so that when the library is used, it does not block the synchronization context in use by the application (e.g. [&hellip;]<\/p>\n","protected":false},"author":581,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[148,114],"class_list":["post-6185","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-permierdev","tag-asynchronous","tag-ben-williams"],"acf":[],"blog_post_summary":"<p>In his latest blog post, Premier Developer consultant Ben Williams brings us this article on asynchronous code. One of the general recommendations you may often read is to use ConfigureAwait(false) in library code. This is so that when the library is used, it does not block the synchronization context in use by the application (e.g. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/6185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=6185"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/6185\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=6185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=6185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=6185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}