Skip to content

Visual Studio gives warning CS1998 on lambda function #47

@jasonjoh

Description

@jasonjoh

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

This is the offending code:

var graphClient = new GraphServiceClient(
    new DelegateAuthenticationProvider(
        async (requestMessage) =>
        {
            requestMessage.Headers.Authorization =
                new AuthenticationHeaderValue("Bearer", accessToken);
        }));

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions