Replies: 2 comments 2 replies
-
The .csproj for the identity client only includes the BrowserTabActivity when targeting the MonoAndroid runtimes, as per: I assume we'll need a .NET 6.0./MAUI build of the MSAL library to be able to use it. |
Beta Was this translation helpful? Give feedback.
-
I was able to repro the issue and found a way that works. I think this is related to Visual Studio versions 2019 Preview vs 2022 Preview. I added MSAL NuGet reference to the HelloMaui Android project. When I built the project with VS 2019, it pulled netcoreapp2.1 MSAL binary (which doesn't have the Android stuff). When I built with VS 2022, it pulled the correct monoandroid binary and built the project successfully. From the official docs, seems like 2022 should be used for Maui development. Can you try with VS 2022 to see if it works for you? I used VS 2019 (16.11.0 Preview 3.0) and VS 2022 (17.0.0 Preview 2.1) for this. For reference Net6.0 precedence rules |
Beta Was this translation helpful? Give feedback.
-
I'm trying to integrate Azure AD B2C into MAUI. Basically, I was starting with the dotnet6 mobile sample and following the Xamarin instruction here with some tweaks.
I've added Microsoft.Identity.Client library into HelloMaui.csproj file:
And I've tried to extend BrowserTabActivity:
However, I've got an error when I try to build:
/net6-mobile-samples/HelloMaui/Android/MsalActivity.cs(17,33): error CS0246: The type or namespace name 'BrowserTabActivity' could not be found (are you missing a using directive or an assembly reference?) [/Users/sxu/work/demo/maui-samples/net6-mobile-samples/HelloMaui/HelloMaui.csproj]
I thought BrowserTabActivity was a member of Microsoft.Identity.Client library and I can reference the other members of the library like "MsalUiRequiredException" without any problem. Could anyone please let me know what could be the reason for this error? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions