How do i solve this type error?
why do i get,
CS1503 Argument 1: cannot convert from 'Microsoft.AspNetCore.Authentication.AuthenticateResult' to 'Microsoft.Identity.Client.AuthenticationResult
9 Replies
This is the userinformation class:
Because you're trying to use two completely different types?
One is
AuthenticateResult
from this extension method: https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.authenticationhttpcontextextensions.authenticateasync?view=aspnetcore-8.0AuthenticationHttpContextExtensions.AuthenticateAsync Method (Micro...
Authenticate the current request using the default authentication scheme. The default authentication scheme can be configured using DefaultAuthenticateScheme.
While the method you've written is expecting
AuthenticationResult
from an entirely different namespacei know that but
I did using
icrosoft.AspNetCore.Authentication.AuthenticateResult
at the top of the file
and it only gives me the option for Microsoft.Identity.Client.AuthenticationResult
public static string GetGoogleId(AuthenticationResult result)
fix the type name of your argument here and see if you're able to import the correct namespacelet me show you something
do you see what i mean?
i only have one option
Please read the type names I posted earlier. You're not typing the correct one.
oh
sorry
you are right
i was ikmprting the wrong one