MSAL in .NET 4.8 framework getting null reference error during running embedded browser

Dilip kumar 0 Reputation points
2024-07-08T07:26:51.9333333+00:00

I am getting this error in MSAL library for .net for publicclient application Capture

microsoft.identity.client version 4.60.3.0

microsoft.identityModel.abstraction. 6.35.0.41

I have entered authenticator code 2 digits number in embedded browser 3 to 4 times again and again then this issue is raisingUsing the sample application provided for 4.8 .NET framework also having same issue In approve request login page
https://github.com/Azure-Samples/ms-identity-docs-code-dotnet/tree/main/desktop-wpf

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Authenticator
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2024-07-08T07:26:51.9733333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error you are seeing in MSAL.NET for .NET 4.8 framework with an embedded browser may be related to a bug in the WebView2 SDK on the .NET Framework platform. One workaround is to add a <PlatformTarget> with values AnyCPU, x86, or x64 to your application project file. x86 or x64 have to match the target framework of the WebView2 installed on the machine. Another workaround is to add <PlatformTarget>AnyCPU</PlatformTarget> in your app's project file and also directly reference the WebView2 NuGet package. For more information, see Using WebView2 with MSAL.NET.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.