The first error message couldn't be any clearer: you're trying to use
await
in a method which isn't marked as
async
. The message even tells you how to fix the error!
The
MicrosoftAccountOAuth
class appears to be part of
this project[
^], not part of the core SDK. Have you added a reference to the project, and a
using MicrosoftAccount.WindowsForms;
directive at the top of your code?
The LoginAuthorizationCodeFlowAsync
method[
^] doesn't return a
Task<string>
- it returns a
Task<AppTokenResult>
. You will need to update your method signature and
appToken
variable to match.