AzureAD / microsoft-authentication-library-for-dotnet

Microsoft Authentication Library (MSAL) for .NET
https://aka.ms/msal-net
MIT License
1.41k stars 345 forks source link

[Bug] WebView2 inside Microsoft.Identity.Client.Desktop have conflicts with Microsoft.WinUI in latest WinAppSDK #4957

Open Arslan007 opened 1 month ago

Arslan007 commented 1 month ago

Library version used

4.65.0

.NET version

.NET 8

Scenario

PublicClient - desktop app

Is this a new or an existing app?

The app is in production, and I have upgraded to a new version of MSAL

Issue description and reproduction steps

.NET workload for maui-windows is updated lately and which have latest WinUI changes. If your Maui windows have reference for Microsoft.Identity.Client.Desktop and you are using embedded browser then your build stop building due to these issues

.NET SDK Version: 8.0.403 Maui Version: 8.0.82/8.0.100 Windows App SDK: 1.6.1 (1.6.240923002)

Here are the error logs

D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1296,125): error CS0433: The type 'CoreWebView2' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\IClient.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1297,125): error CS0433: The type 'CoreWebView2AcceleratorKeyPressedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1305,125): error CS0433: The type 'CoreWebView2CompositionController' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\IClient.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1306,125): error CS0433: The type 'CoreWebView2ContentLoadingEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1310,125): error CS0433: The type 'CoreWebView2Controller' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1313,125): error CS0433: The type 'CoreWebView2Cookie' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1314,125): error CS0433: The type 'CoreWebView2CookieManager' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1316,125): error CS0433: The type 'CoreWebView2DOMContentLoadedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1317,125): error CS0433: The type 'CoreWebView2DevToolsProtocolEventReceivedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1318,125): error CS0433: The type 'CoreWebView2DevToolsProtocolEventReceiver' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1321,125): error CS0433: The type 'CoreWebView2Environment' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1322,125): error CS0433: The type 'CoreWebView2EnvironmentOptions' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1326,125): error CS0433: The type 'CoreWebView2FrameInfo' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1327,125): error CS0433: The type 'CoreWebView2HttpHeadersCollectionIterator' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1328,125): error CS0433: The type 'CoreWebView2HttpRequestHeaders' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1329,125): error CS0433: The type 'CoreWebView2HttpResponseHeaders' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1331,125): error CS0433: The type 'CoreWebView2MoveFocusRequestedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1332,125): error CS0433: The type 'CoreWebView2NavigationCompletedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1333,125): error CS0433: The type 'CoreWebView2NavigationStartingEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1334,125): error CS0433: The type 'CoreWebView2NewWindowRequestedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1335,125): error CS0433: The type 'CoreWebView2PermissionRequestedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1337,125): error CS0433: The type 'CoreWebView2PointerInfo' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1340,125): error CS0433: The type 'CoreWebView2ProcessFailedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1343,125): error CS0433: The type 'CoreWebView2ScriptDialogOpeningEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1345,125): error CS0433: The type 'CoreWebView2Settings' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1347,125): error CS0433: The type 'CoreWebView2SourceChangedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1348,125): error CS0433: The type 'CoreWebView2WebMessageReceivedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1349,125): error CS0433: The type 'CoreWebView2WebResourceRequest' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1350,125): error CS0433: The type 'CoreWebView2WebResourceRequestedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1351,125): error CS0433: The type 'CoreWebView2WebResourceResponse' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1352,125): error CS0433: The type 'CoreWebView2WebResourceResponseReceivedEventArgs' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1353,125): error CS0433: The type 'CoreWebView2WebResourceResponseView' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\1\s\src\client\Client.App\obj\Release\net8.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.RcwReflectionFallbackGenerator\RcwFallbackInitializer.g.cs(1354,125): error CS0433: The type 'CoreWebView2WindowFeatures' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' [D:\a\1\s\src\client\Client.App\Client.App.csproj::TargetFramework=net8.0-windows10.0.19041.0]

This issue can easily reproduced with this Azure Maui Sample

https://github.com/Azure-Samples/ms-identity-dotnetcore-maui

Tried workarounds

Added explicit app package reference from nuget https://www.nuget.org/packages/Microsoft.WindowsAppSDK/1.6.240923002

with this its builds fine but then embedded browser never opens.

Relevant code snippets

public async Task<IAccount> InitializePublicClientAppAsync()
        {
            // Initialize the MSAL library by building a public client application
            this.PublicClientApplication = this.PublicClientApplicationBuilder
                .WithRedirectUri(PlatformConfig.Instance.RedirectUri)   // redirect URI is set later in PlatformConfig when the platform has been decided
#if WINDOWS
                .WithWindowsEmbeddedBrowserSupport()
#endif
                .Build();

            await AttachTokenCache();
            return await FetchSignedInUserFromCache().ConfigureAwait(false);
        }

Expected behavior

It should compile as expected and embedded browser work

Identity provider

Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)

Regression

No response

Solution and workarounds

No

nicop85 commented 4 weeks ago

Same problem here! I'm using an older version 4.61.3, but it is the same with the latest build as well 4.66.1

In my case the problem started after updating Visual Studio to it's last version 17.11.5.