-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper rewrite for await using with variable #28
Comments
I was just about to post this. Current version of 5.0.0 calls this example code of mine as a possibility of missing await using FileStream fileStream = File.Open(sentryFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite); How am I expected to rewrite this bit to satisfy the warning? I've tried various ideas that came to my mind but they all resulted in error of converting |
Yeah, v5.0 was pushed few moments ago. I'm preparing the blog post.
You need to do something like this https://www.tabsoverspaces.com/233779-using-await-using-iasyncdisposable-with-configureawait.
|
Thanks a lot, that did the trick! Leaving the answer for people that might stumble upon this as well: FileStream fileStream = File.Open(sentryFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
await using (fileStream.ConfigureAwait(false)) {
// ...
} |
For example this
with
ConfigureAwait(false)
will result intest
beingConfiguredAsyncDisposable
type.The text was updated successfully, but these errors were encountered: