---
title: "Discussion on \"Why you may be doing async wrong, in C#.\" | Hashnode"
description: "Discussion on \"Why you may be doing async wrong, in C#.\". Asynchronous code not performing as expected? See testable examples of how async / await can be applied in C# & .Net for better asynchronous code."
url: "https://hashnode.com/posts/why-you-may-be-doing-async-wrong-in-c/626dc973454011df6e86c04d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why you may be doing async wrong, in C#.](https://alt-dev.com.au/why-you-may-be-doing-async-wrong-in-c?utm_source=hashnode&utm_medium=feed)

Asynchronous code not performing as expected? See testable examples of how async / await can be applied in C# & .Net for better asynchronous code.

Apr 30, 2022 · 10 min read · alt-dev.com.au  
Updated Sep 7  
Read the article

-   [#csharp](https://hashnode.com/tag/csharp)
-   [#asynchronous](https://hashnode.com/tag/asynchronous)
-   [#dotnet](https://hashnode.com/tag/dotnet)
-   [#net](https://hashnode.com/tag/net)
-   [#await](https://hashnode.com/tag/await)

## Written by

[Ashley Rowe](https://hashnode.com/@altdevau)

@altdevau · Brisbane, Australia

  
[View profile](https://hashnode.com/@altdevau)

Writer of code, teacher of things.

I am a Full Stack Developer from Brisbane, Australia . I enjoy learning and sharing my knowledge with others.

## Responses 1

Markdown supported · ⌘↵ to post

[Victor Palomares](https://hashnode.com/@vicpada)

[May 4, 2022](https://hashnode.com/posts/why-you-may-be-doing-async-wrong-in-c/626dc973454011df6e86c04d/comment/62725ad5a5082d2298783134)

Nice article Ashley! As a point of favour of WhenAll is that the AggregateException is only raised with `WaitAll`. `WhenAll` or individual calls would raise the original exception.

[Ashley Rowe](https://hashnode.com/@altdevau)

[May 6, 2022](https://hashnode.com/posts/why-you-may-be-doing-async-wrong-in-c/626dc973454011df6e86c04d/comment/62725ad5a5082d2298783134#reply-627584ec317fc95a74ca696d)

Thanks, Victor. Yes, there are absolutely use cases for each. Sometimes you may wish to unwrap the aggregate exception from WaitAll, other times you may not.

Something to keep in mind is that although WhenAll does not wrap the exception, it only returns the first exception. This means that if multiple exceptions, you only see the first, though it will ensure all tasks run to completion.
