{"id":627,"date":"2021-11-24T13:25:20","date_gmt":"2021-11-24T13:25:20","guid":{"rendered":"https:\/\/www.naveedulhaq.com\/?p=627"},"modified":"2021-11-26T18:19:47","modified_gmt":"2021-11-26T18:19:47","slug":"resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound","status":"publish","type":"post","link":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/","title":{"rendered":"Resolve: This async method lacks &#8216;await&#8217; operators and will run synchronously. Consider using the &#8216;await&#8217; operator to await non-blocking API calls, or &#8216;await Task.Run(\u2026)&#8217; to do CPU-bound work on a background thread."},"content":{"rendered":"\n<p>I come across the following warning during working on one of my projects. I looked at the internet and it seems this is very common so I thought I&#8217;ll add notes to resolve it. This warning could be dangerous and result in a logical error or fairly pointless. So please bear with me to understand the concept. <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>CS 1998 This async method lacks &#8216;await&#8217; operators and will run synchronously. Consider using the &#8216;await&#8217; operator to await non-blocking API calls, or &#8216;await Task.Run(\u2026)&#8217; to do CPU-bound work on a background thread.<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Reason (Why)<\/h2>\n\n\n\n<p>Commonly it happens in places where you add the async method in your interface but your code does not actually need the async method. <\/p>\n\n\n\n<p>For example<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Interface<\/h3>\n\n\n\n<pre><code>public interface IFoo\n{\n    Task Test();\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Implementation<\/h3>\n\n\n\n<pre><code>public class Foo: IFoo\n{\n    public async Task Test()\n    {\n        if (user.Username == \"test-user\")\nthrow new Exception(\"can not use test user\");\n            \n    }\n}<\/code><\/pre>\n\n\n\n<p>You can see in the above example the code is not really async but the method suppose to return the result asynchronously.<\/p>\n\n\n\n<p>So that&#8217;s why when you run this code you will get this warning. You can either ignore this warning or change your method not to return async.<\/p>\n\n\n\n<p>You need to be very careful. You might end up removing async from your method without really analysing the rest of the code can return results asynchronously.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution:<\/h2>\n\n\n\n<p>You can add &#8220;<strong>Task.CompletedTask;<\/strong>&#8221; at the end of your task. Like below<\/p>\n\n\n\n<pre><code>\n\npublic class Foo: IFoo\n{\n    public async Task Test()\n    {\n        if (user.Username == \"test-user\")\nthrow new Exception(\"can not use test user\");\nreturn Task.CompletedTask;\n            \n    }\n}\n\n<\/code><\/pre>\n\n\n\n<p>You can suppress this warning in your project like below. If you think this is harmless<\/p>\n\n\n\n<pre><code>&lt;Project Sdk=\"Microsoft.NET.Sdk.Web\">\n  &lt;PropertyGroup>\n    &lt;NoWarn>1998&lt;\/NoWarn>\n  &lt;\/PropertyGroup>\n...\n&lt;\/Project><\/code><\/pre>\n\n\n\n<p>You can ignore this warning. If you think this is harmless<\/p>\n\n\n\n<p>you can also add Do nothing by adding &#8220;<strong>await Task.Yield()<\/strong>;&#8221;. But this is absolutely not recommended. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I come across the following warning during working on one of my projects. I looked at the internet and it seems this is very common&#8230;<\/p>\n","protected":false},"author":1,"featured_media":72,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[11,8,32,56],"class_list":["post-627","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dot-net-core","tag-dot-net-core","tag-dot-net-framework","tag-developer","tag-visual-studio"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Resolve: This async method lacks &#039;await&#039; operators and will run synchronously. Consider using the &#039;await&#039; operator to await non-blocking API calls, or &#039;await Task.Run(\u2026)&#039; to do CPU-bound work on a background thread.<\/title>\n<meta name=\"description\" content=\"CS 1998 - This async method lacks &#039;await&#039; operators and will run synchronously. Consider using the &#039;await&#039; operator to await.... - Naveed Ul-Haq&#039;s blog\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Resolve: This async method lacks &#039;await&#039; operators and will run synchronously. Consider using the &#039;await&#039; operator to await non-blocking API calls, or &#039;await Task.Run(\u2026)&#039; to do CPU-bound work on a background thread.\" \/>\n<meta property=\"og:description\" content=\"CS 1998 - This async method lacks &#039;await&#039; operators and will run synchronously. Consider using the &#039;await&#039; operator to await.... - Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/\" \/>\n<meta property=\"og:site_name\" content=\"Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-24T13:25:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-26T18:19:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2019\/04\/240px-.NET_Core_Logo.svg_.png\" \/>\n\t<meta property=\"og:image:width\" content=\"240\" \/>\n\t<meta property=\"og:image:height\" content=\"240\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Naveed Ul-Haq\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Ul-Haq\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/\"},\"author\":{\"name\":\"Naveed Ul-Haq\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"headline\":\"Resolve: This async method lacks &#8216;await&#8217; operators and will run synchronously. Consider using the &#8216;await&#8217; operator to await non-blocking API calls, or &#8216;await Task.Run(\u2026)&#8217; to do CPU-bound work on a background thread.\",\"datePublished\":\"2021-11-24T13:25:20+00:00\",\"dateModified\":\"2021-11-26T18:19:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/\"},\"wordCount\":289,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/240px-.NET_Core_Logo.svg_.png\",\"keywords\":[\".net core\",\".net framework\",\"developer\",\"visual-studio\"],\"articleSection\":[\".NET\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/\",\"name\":\"Resolve: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(\u2026)' to do CPU-bound work on a background thread.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/240px-.NET_Core_Logo.svg_.png\",\"datePublished\":\"2021-11-24T13:25:20+00:00\",\"dateModified\":\"2021-11-26T18:19:47+00:00\",\"description\":\"CS 1998 - This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await.... - Naveed Ul-Haq&#039;s blog\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/240px-.NET_Core_Logo.svg_.png\",\"contentUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/240px-.NET_Core_Logo.svg_.png\",\"width\":240,\"height\":240,\"caption\":\".net core\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resolve: This async method lacks &#8216;await&#8217; operators and will run synchronously. Consider using the &#8216;await&#8217; operator to await non-blocking API calls, or &#8216;await Task.Run(\u2026)&#8217; to do CPU-bound work on a background thread.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\",\"name\":\"Naveed Ul-Haq's blog\",\"description\":\"AI, Optimizely, Azure &amp; more\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.naveedulhaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\",\"name\":\"Naveed Ul-Haq\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"caption\":\"Naveed Ul-Haq\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\"},\"description\":\"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\\\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\\\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.\",\"sameAs\":[\"https:\\\/\\\/www.naveedulhaq.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedulhaq\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Resolve: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(\u2026)' to do CPU-bound work on a background thread.","description":"CS 1998 - This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await.... - Naveed Ul-Haq&#039;s blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/","og_locale":"en_GB","og_type":"article","og_title":"Resolve: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(\u2026)' to do CPU-bound work on a background thread.","og_description":"CS 1998 - This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await.... - Naveed Ul-Haq&#039;s blog","og_url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/","og_site_name":"Naveed Ul-Haq&#039;s blog","article_published_time":"2021-11-24T13:25:20+00:00","article_modified_time":"2021-11-26T18:19:47+00:00","og_image":[{"width":240,"height":240,"url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2019\/04\/240px-.NET_Core_Logo.svg_.png","type":"image\/png"}],"author":"Naveed Ul-Haq","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Ul-Haq","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/#article","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/"},"author":{"name":"Naveed Ul-Haq","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"headline":"Resolve: This async method lacks &#8216;await&#8217; operators and will run synchronously. Consider using the &#8216;await&#8217; operator to await non-blocking API calls, or &#8216;await Task.Run(\u2026)&#8217; to do CPU-bound work on a background thread.","datePublished":"2021-11-24T13:25:20+00:00","dateModified":"2021-11-26T18:19:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/"},"wordCount":289,"commentCount":0,"publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2019\/04\/240px-.NET_Core_Logo.svg_.png","keywords":[".net core",".net framework","developer","visual-studio"],"articleSection":[".NET"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/","url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/","name":"Resolve: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(\u2026)' to do CPU-bound work on a background thread.","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/#primaryimage"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2019\/04\/240px-.NET_Core_Logo.svg_.png","datePublished":"2021-11-24T13:25:20+00:00","dateModified":"2021-11-26T18:19:47+00:00","description":"CS 1998 - This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await.... - Naveed Ul-Haq&#039;s blog","breadcrumb":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/#primaryimage","url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2019\/04\/240px-.NET_Core_Logo.svg_.png","contentUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2019\/04\/240px-.NET_Core_Logo.svg_.png","width":240,"height":240,"caption":".net core"},{"@type":"BreadcrumbList","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/resolve-this-async-method-lacks-await-operators-and-will-run-synchronously-consider-using-the-await-operator-to-await-non-blocking-api-calls-or-await-task-run-to-do-cpu-bound\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.naveedulhaq.com\/"},{"@type":"ListItem","position":2,"name":"Resolve: This async method lacks &#8216;await&#8217; operators and will run synchronously. Consider using the &#8216;await&#8217; operator to await non-blocking API calls, or &#8216;await Task.Run(\u2026)&#8217; to do CPU-bound work on a background thread."}]},{"@type":"WebSite","@id":"https:\/\/www.naveedulhaq.com\/#website","url":"https:\/\/www.naveedulhaq.com\/","name":"Naveed Ul-Haq's blog","description":"AI, Optimizely, Azure &amp; more","publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.naveedulhaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9","name":"Naveed Ul-Haq","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","caption":"Naveed Ul-Haq"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g"},"description":"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.","sameAs":["https:\/\/www.naveedulhaq.com","https:\/\/www.linkedin.com\/in\/naveedulhaq\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/comments?post=627"}],"version-history":[{"count":0,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/627\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media\/72"}],"wp:attachment":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media?parent=627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/categories?post=627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/tags?post=627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}