Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug] Cannot compile Windows MAUI .NET 9 project when referencing Microsoft.Identity.Client.Desktop #4993

Open
superwilly1 opened this issue Nov 13, 2024 · 5 comments
Labels
needs attention Delete label after triage untriaged Do not delete. Needed for Automation

Comments

@superwilly1
Copy link

Library version used

4.66.2

.NET version

.NET 9 MAUI

Scenario

Other - please specify

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

Today we updated our MAUI app from .NET 8 to .NET 9.
Android and iOS are fine, but Windows does not work with the Microsoft.Identity.Client.Desktop package.
The app cannot compile, showing these error messages:
Cannot resolve Assembly or Windows Metadata file 'Type universe cannot resolve assembly: System.Xaml, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.'
and:
Could not copy the file "C:\temp\NET9MAUIWindowsIssue\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\Platforms\Windows\App.xbf" because it was not found.

These errors also occur in a file->new->MAUI project, and only adding the package reference.
No code changed in the new MAUI app, only added the package reference.
See the example project in the attached zipfile:
NET9MAUIWindowsIssue.zip

Only the Desktop package is an issue, these packages work:

<PackageReference Include="Microsoft.Identity.Client" Version="4.66.2" />
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.66.2" />

Relevant code snippets

Only change needed to reproduce is to add this to the .csproj file (of an empty new .NET MAUI project), referencing the NuGet package:

<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
	<PackageReference Include="Microsoft.Identity.Client.Desktop" Version="4.66.2" />
</ItemGroup>

Expected behavior

The app should compile (and work) on .NET9, like it also used to work on .NET8.

Identity provider

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

Regression

No response

Solution and workarounds

No solution or workaround as of yet.

@superwilly1 superwilly1 added needs attention Delete label after triage untriaged Do not delete. Needed for Automation labels Nov 13, 2024
@kittykmartin
Copy link

we also have exsactly the same as usual a MAUI upgrade nightmare

@nicop85
Copy link

nicop85 commented Nov 15, 2024

Same problem here. This is urgent since without that users aren't able to perform logins in my App

@kittykmartin
Copy link

kittykmartin commented Nov 15, 2024 via email

@PureWeen
Copy link

I don't think this is a .NET MAUI issue

I was able to reproduce here on a WinUI app that doesn't use MAUI

App11.zip

@Maxxelemel
Copy link

Thank you,
Do we think it's a .net 9 thing then?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
needs attention Delete label after triage untriaged Do not delete. Needed for Automation
Projects
None yet
Development

No branches or pull requests

5 participants