Skip to content
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

[BUG] Supported Platforms Inconsistent for MAUI, Community Toolkit, and Docs #2553

Closed
2 tasks done
SteveBush opened this issue Feb 22, 2025 · 2 comments
Closed
2 tasks done
Labels
bug Something isn't working unverified

Comments

@SteveBush
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

The supported versions in the Microsoft Learn documentation do not match the supported versions in the csproj or the recently attributed AppBuilderExtensions. The system requirements for the Maui Toolkit should reflect the system requirements for MAUI.

For my MAUI app projects, I had targeted the minimal requirements for MAUI, expecting the community toolkit to have the same system requirements. The docs on Microsoft Learn for community toolkit don't reflect what's in the csproj and attributed on AppBuilderExtensions.

Maui System Requirements:
https://learn.microsoft.com/en-us/dotnet/maui/supported-platforms?view=net-maui-9.0

NET Multi-platform App UI (.NET MAUI) apps can be written for the following platforms:

Android 5.0 (API 21) or higher is required.
iOS 12.2 or higher is required.
macOS 12 or higher, using Mac Catalyst.
Windows 11 and Windows 10 version 1809 or higher, using [Windows UI Library (WinUI) 3](https://learn.microsoft.com/en-us/windows/apps/winui/winui3/).

MAUI Community Toolkit on Microsoft Learn:
https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/

Supported versions
The .NET MAUI Community Toolkit supports the platforms officially supported by [Microsoft](https://learn.microsoft.com/en-us/dotnet/maui/supported-platforms):

Android 5.0 (API 21) or higher.
iOS 10 or higher.
macOS 10.15 or higher, using Mac Catalyst.
Windows 11 and Windows 10 version 1809 or higher, using [Windows UI Library (WinUI) 3](https://learn.microsoft.com/en-us/windows/apps/winui/winui3/).
Tizen 7.0 or higher.

CommunityToolkit.Maui.csproj:

    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
    <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>

Expected Behavior

Ideally, Community Toolkit would have the same requirements as MAUI and the documentation updated to reflect the correct system requirements.

Steps To Reproduce

Visit Learn articles for MAUI and Community Toolkit
Compare SupportedPlatform for MAUI and Community Toolkit

Link to public reproduction project repository

https://github.com/CommunityToolkit/Maui/blob/main/src/CommunityToolkit.Maui/CommunityToolkit.Maui.csproj

Environment

- .NET MAUI CommunityToolkit: 11.1.0
- OS:
- .NET MAUI: 9.0.40

Anything else?

No response

@SteveBush SteveBush added bug Something isn't working unverified labels Feb 22, 2025
@TheCodeTraveler
Copy link
Collaborator

TheCodeTraveler commented Feb 22, 2025

Duplicate: #2528

We have a PR open to update the docs: MicrosoftDocs/CommunityToolkit#524

@TheCodeTraveler TheCodeTraveler closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2025
@SteveBush
Copy link
Author

@TheCodeTraveler: I'm sorry. I missed the Microsoft Docs PR in my search, and the MAUI templates use IOS and MacCatalyst version 15+.

By attributing AppBuilderExtensions, I think you are indicating that the whole community toolkit only supports IOS and MacCatalyst 15+ and should not be used with versions prior to 15.

In my library projects, I have a minimum requirement for the library stated in the documentation and then attribute individual APIs with UnsupportedOSPlatform if the API isn't compatible with a specific OS platform version. It's a pain as you end up following these dependency chains of API calls to make sure both the caller and callee reflect the correct platform version. You also have to test with the lower platform versions. The upside is the developer can pick and choose using APIs appropriate to their supported platform versions.

As a point of comparison, MAUI doesn't use the UnsupportedOSPlatform attribute on the MAUI builder class but on individual APIs. This allows the developer to know which APIs are unsupported on which OS platforms and produce their own workarounds. The alternative for a developer who wants to support previous OS versions is to ignore the pragma and test the APIs they use on unsupported OS versions.

I can totally understand the approach of gating the whole framework for simplicity and testing purposes. I'm just trying to understand the rationale for my own library development.

Thanks for listening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unverified
Projects
None yet
Development

No branches or pull requests

2 participants