Skip to content

Unable to access UniformTypeIdentifiers.UTType.Folder in C# #25333

@KarthikRajaKalaimani

Description

@KarthikRajaKalaimani

Description:
When targeting .NET 10 (net10.0-maccatalyst) with .NET MAUI, the UniformTypeIdentifiers.UTType.Folder property is not available in the C# bindings. This prevents developers from using the modern UIDocumentPickerViewController(UTType[], UIDocumentPickerMode) API for folder picking, which is the recommended approach for MacCatalyst 14+.

Expected Behavior:

UniformTypeIdentifiers.UTType.Folder should be available in the .NET MAUI MacCatalyst bindings, allowing developers to use:

var picker = new UIDocumentPickerViewController(new UTType[] { UTType.Folder }, UIDocumentPickerMode.Open);
Actual Behavior:
The following error occurs:
'UTType' does not contain a definition for 'Folder'
Developers are forced to use the obsolete string[] overload with "public.folder":

var picker = new UIDocumentPickerViewController(new string[] { "public.folder" }, UIDocumentPickerMode.Open);
This triggers obsolescence warnings and is not future-proof.

Steps to Reproduce
Create a .NET MAUI 10 project targeting net10.0-maccatalyst.
Attempt to use UniformTypeIdentifiers.UTType.Folder in code.
Observe that the property does not exist.
Environment:

.NET MAUI 10
Target: net10.0-maccatalyst
macOS (latest)

MacAppIssue.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    need-infoWaiting for more information before the bug can be investigated

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions