# ConfigureAwait
**Repository Path**: mirrors_Fody/ConfigureAwait
## Basic Information
- **Project Name**: ConfigureAwait
- **Description**: Configure async code's ConfigureAwait at a global level
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-01-06
- **Last Updated**: 2026-02-15
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
#
ConfigureAwait.Fody
[](https://www.nuget.org/packages/ConfigureAwait.Fody/)
Configure async code's [`ConfigureAwait`](https://msdn.microsoft.com/en-us/library/system.threading.tasks.task.configureawait) at a global level.
**See [Milestones](../../milestones?state=closed) for release notes.**
### This is an add-in for [Fody](https://github.com/Fody/Home/)
**It is expected that all developers using Fody [become a Patron on OpenCollective](https://opencollective.com/fody/contribute/patron-3059). [See Licensing/Patron FAQ](https://github.com/Fody/Home/blob/master/pages/licensing-patron-faq.md) for more information.**
## Usage
See also [Fody usage](https://github.com/Fody/Home/blob/master/pages/usage.md).
### NuGet package
Install the [ConfigureAwait.Fody NuGet package](https://nuget.org/packages/ConfigureAwait.Fody/) and update the [Fody NuGet package](https://nuget.org/packages/Fody/):
```
PM> Install-Package Fody
PM> Install-Package ConfigureAwait.Fody
```
The `Install-Package Fody` is required since NuGet always defaults to the oldest, and most buggy, version of any dependency.
### How to use it
By default, `ConfigureAwait.Fody` doesn't change any code. Set a configure await value at the assembly, class, or method level.
* `[assembly: Fody.ConfigureAwait(false)]` - Assembly level
* `[Fody.ConfigureAwait(false)]` - Class or method level
Explicitly configured awaiters will not be overwritten by the weaver, allowing exceptions to the Assembly / Class / Method level setting.
### Add to FodyWeavers.xml
Add `` to [FodyWeavers.xml](https://github.com/Fody/Home/blob/master/pages/usage.md#add-fodyweaversxml)
```xml
```
It is also possible set the default ContinueOnCapturedContext in the xml config:
```xml
```
## Example
### Before code
```csharp
using Fody;
[ConfigureAwait(false)]
public class MyAsyncLibrary
{
public async Task MyMethodAsync()
{
await Task.Delay(10);
await Task.Delay(20).ConfigureAwait(true);
}
public async Task AnotherMethodAsync()
{
await Task.Delay(30);
}
}
```
### What gets compiled
```csharp
public class MyAsyncLibrary
{
public async Task MyMethodAsync()
{
await Task.Delay(10).ConfigureAwait(false);
await Task.Delay(20).ConfigureAwait(true);
}
public async Task AnotherMethodAsync()
{
await Task.Delay(30).ConfigureAwait(false);
}
}
```
## Icon
Created by Dmitry Baranovskiy from [The Noun Project](https://thenounproject.com).