<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/first-steps-with-asynchronous-programming-in-c--aw7ghq7w6" -->

---
title: First steps with asynchronous programming in C# | daily.dev
description: An introductory walkthrough of asynchronous programming in C#, covering the async/await keywords, Task vs ValueTask, async Main in console apps, calling async...
canonical: https://daily.dev/posts/first-steps-with-asynchronous-programming-in-c--aw7ghq7w6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: First steps with asynchronous programming in C# | daily.dev
og:description: An introductory walkthrough of asynchronous programming in C#, covering the async/await keywords, Task vs ValueTask, async Main in console apps, calling async...
og:url: https://daily.dev/posts/first-steps-with-asynchronous-programming-in-c--aw7ghq7w6
og:image: https://api.daily.dev/og/posts/aw7GHQ7W6.png
og:image:alt: First steps with asynchronous programming in C#
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# First steps with asynchronous programming in C#

**[Code4IT](https://daily.dev/sources/code4it)** · 9 min read · 0 upvotes · 0 comments

## Summary

An introductory walkthrough of asynchronous programming in C#, covering the async/await keywords, Task vs ValueTask, async Main in console apps, calling async methods from synchronous contexts and vice versa, and common pitfalls in exception handling (including the AggregateException trap when using .Result instead of .GetAwaiter().GetResult()). Includes runnable code examples and console log traces to illustrate execution flow.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.code4it.dev/blog/asynchronous-programming-in-csharp>

## Questions this post answers

### Why should I use GetAwaiter().GetResult() instead of .Result when calling an async method synchronously in C#?

Using .Result wraps exceptions in an AggregateException with a different, less useful stack trace, making the original error harder to diagnose. GetAwaiter().GetResult() surfaces the original exception type and stack trace directly, so error handling behaves closer to how it would in a fully synchronous call chain.

_daily.dev surfaces practical C# gotchas like this for developers writing resilient async code._

### How do I call an asynchronous method from a synchronous method in C#?

Call GetAwaiter().GetResult() on the task returned by the async method, for example CalculatePageSize().GetAwaiter().GetResult(). This blocks synchronously and returns the unwrapped result, and is preferred over using .Result because it preserves the original exception on failure instead of wrapping it in an AggregateException.

_Developers bridging sync and async C# code can find more patterns like this through daily.dev._

### How do I make a synchronous method run asynchronously in C#?

Wrap the synchronous call in Task.Run(), for example Task.Run(() => DoSomethingSynchronous()), then await the resulting task to get its value. This offloads the blocking work to a separate task so the calling async method is not blocked while it executes.

_daily.dev helps developers adopting async patterns keep these conversion techniques handy._

## Similar posts on daily.dev

- [Async or Swim: The Complete Guide to Asynchronous .NET](https://daily.dev/posts/async-or-swim-the-complete-guide-to-asynchronous-net-n2fszfnf6) · ITNEXT · 9 upvotes · 1 comments
- [How async, await and Task are related in C\#?](https://daily.dev/posts/how-async-await-and-task-are-related-in-c--td1oloovi) · C\# Corner · 25 upvotes · 0 comments
- [Async Pipelines in C\#: Await, Cancellation, and Completion](https://daily.dev/posts/async-pipelines-in-c-await-cancellation-and-completion-gftomtfpg) · We Are .NET · 1 upvotes · 0 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/first-steps-with-asynchronous-programming-in-c--aw7ghq7w6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"First steps with asynchronous programming in C#","url":"https://daily.dev/posts/first-steps-with-asynchronous-programming-in-c--aw7ghq7w6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/first-steps-with-asynchronous-programming-in-c--aw7ghq7w6"},"datePublished":"2026-10-04T13:06:50.510Z","dateModified":"2026-10-04T13:10:43.381Z","description":"An introductory walkthrough of asynchronous programming in C#, covering the async/await keywords, Task vs ValueTask, async Main in console apps, calling async...","image":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","thumbnailUrl":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","isAccessibleForFree":true,"articleSection":"Code4IT","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Code4IT","logo":"https://media.daily.dev/image/upload/s--OaaG4G10--/f_auto,q_auto/v1791119049/logos/code4it?_a=BAMAMicg0","url":"https://daily.dev/sources/code4it"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/first-steps-with-asynchronous-programming-in-c--aw7ghq7w6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":".net,c#","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Code4IT","item":"https://daily.dev/sources/code4it"},{"@type":"ListItem","position":3,"name":"First steps with asynchronous programming in C#"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/first-steps-with-asynchronous-programming-in-c--aw7ghq7w6#faq","mainEntity":[{"@type":"Question","name":"Why should I use GetAwaiter().GetResult() instead of .Result when calling an async method synchronously in C#?","acceptedAnswer":{"@type":"Answer","text":"Using .Result wraps exceptions in an AggregateException with a different, less useful stack trace, making the original error harder to diagnose. GetAwaiter().GetResult() surfaces the original exception type and stack trace directly, so error handling behaves closer to how it would in a fully synchronous call chain. daily.dev surfaces practical C# gotchas like this for developers writing resilient async code."}},{"@type":"Question","name":"How do I call an asynchronous method from a synchronous method in C#?","acceptedAnswer":{"@type":"Answer","text":"Call GetAwaiter().GetResult() on the task returned by the async method, for example CalculatePageSize().GetAwaiter().GetResult(). This blocks synchronously and returns the unwrapped result, and is preferred over using .Result because it preserves the original exception on failure instead of wrapping it in an AggregateException. Developers bridging sync and async C# code can find more patterns like this through daily.dev."}},{"@type":"Question","name":"How do I make a synchronous method run asynchronously in C#?","acceptedAnswer":{"@type":"Answer","text":"Wrap the synchronous call in Task.Run(), for example Task.Run(() => DoSomethingSynchronous()), then await the resulting task to get its value. This offloads the blocking work to a separate task so the calling async method is not blocked while it executes. daily.dev helps developers adopting async patterns keep these conversion techniques handy."}}]}
```

