-
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
Add options for specifying a minimum workload version requirement #25993
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe @dsplaisted can comment on the general problem here? Targeting .NET 9 MAUI packages from a .NET 8 project would certainly default to netstandard2.0
if those exist.
@mattleibow why does Microsoft.Maui.Controls
have netstandard2.0
assemblies inside at all? That is needed for MSBuild tasks inside Visual Studio, so you could simply have a copy of those in the Microsoft.Maui.Controls.Build.Tasks
package? They shouldn't be referenced by customer projects, just used by the MSBuild tasks?
src/Core/src/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Core.targets
Outdated
Show resolved
Hide resolved
Wild idea: provide a net6.0 version of the assemblies that has: [Obsolete ("This version of MAUI requires at least a TargetFramework of ...", IsError = true)] on every API. |
Do we know the answer to this question? MSBuild won't even know how to find these assemblies unless you use |
- Installing a .NET 9 MAUI package into a .NET 8 project | ||
- Installing a .NET 9 MAUI package into a very old .NET 9 installation | ||
|
||
To skip this check, set $(SkipCheckForMauiMinimumSupportedWorkloadVersion) to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need some documentation heads up @davidortinau @rachelkang .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to advertise this option? It will only cause pain, and I just added this as a failsafe just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a test where we try to install this on a machine with net8 sdk only? I know it might be tricky. but I think that will cover this edge case works.
Also I think the message needs to be localized.
/rebase |
If we detect that you have installed .NET MAUI into a TFM which is not found in the package, then we will fail the build. The error code is MA003 and there is a property to skip this warning as well: Errors will look like: - error MA003: This version of .NET MAUI requires at least a TargetFramework of 'net9.0-windows10.0.19041.0', which is greater than the current TargetFramework 'net8.0-windows10.0.19041.0'. - error MA003: This version of .NET MAUI requires at least a TargetFramework of 'net9.0-ios', which is greater than the current TargetFramework 'net8.0-ios'. - error MA003: This version of .NET MAUI requires at least a TargetFramework of 'net9.0-maccatalyst17.0', which is greater than the current TargetFramework 'net8.0-maccatalyst17.0'.
This happens mostly in the maui repo, but also may happen if the build is not using workloads. This is not really possible outside of the maui repo source build.
39949fc
to
69d009b
Compare
Description of Change
If we detect that you have installed .NET MAUI NuGet packages into an SDK which has some old version of the .NET MAUI workload, then we will fail the build.
The error code is MA003 and there is a property to skip this warning as well:
$(SkipCheckForMauiMinimumSupportedWorkloadVersion)
Errors will look like:
Issues Fixed
Fixes #25970