-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error message when users are referencing a .NET 9 NUGET from a .NET 8 TFM #25970
Comments
When you update MAUI nugets from 8 to 9 version you also have to change the .net version in .csproj from net8.0 to net9.0. Refer to docs for more details https://learn.microsoft.com/en-us/dotnet/maui/whats-new/dotnet-9?view=net-maui-9.0#upgrade-from-net-8-to-net-9 |
@OvrBtn so, can't I update to MAUI 9 using .NET 8? Then, shouldn't developers specify that MAUI 9 nuget requires .net 8, so it would give me an error when trying updating it? |
Correct, I've updated the title of this issue We should really throw a better exception when users are trying to reference net9 nugets inside a net8 project |
Another option here is to actually drop netstandard and use net47 or something for the IDE only? In our targets we can use net9.0 in apps and net4x in the IDE. We lose the netstandard, but that is something we actually want, right? @Redth @PureWeen @mgoertz-msft @mauroa @jonathanpeppers @dellis1972 any thoughts on this? |
Not sure I get how using netstandard for the sdk stuff is related to this issue? |
I can solve the problem by removing netstandard from the nuget package and instead building for net47. Does the Android workload have netstandard2.0 build tasks, or does it multitarget net8.0 and net4x? I can either write a complex logic to detect a scenario where the user installed newer nugets into an older project - like maui 9 into net8 and then throw an error. Or, we can let NuGet install fail with a useful error message. |
We only use netstandard2.0 cos it works everywhere. |
Description
In a class under my Windows platform folder, the following types are missing:
Microsoft.UI.Xaml.Application
Microsoft.UI.Xaml.UnhandledExceptionEventArgs
This happened after updating these packages:
Microsoft.Maui.Controls 8.0.92 → 9.0.10
Microsoft.Maui.Controls.Compatibility 8.0.92 → 9.0.10
This is my .csproj (targeting net8.0-*)
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
9.0.10 SR1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.92 SR9.2
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: