Skip to content

Guidance for ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult Method is too absolute #7777

@JimDaly

Description

@JimDaly

The remarks in this reference topic: ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult Method says:

This method is intended for compiler use; do not use it directly in your code.

While this is generally a good recommendation when working with asynchronous modern web applications, the absolute statement makes developers feel it is never appropriate.

For the use case in our product, we recommend people use this. See Microsoft Dataverse Plug-ins > Troubleshoot plug-ins > Unhandled exception in plugin . The code they are writing is single-threaded, synchronous using HttpClient.
The GetResult method allows better method to get the specific error caused by a failure.

Recommend description be changed to something like 'This method isn’t recommended for modern applications designed to use asynchronous patterns.'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions