Skip to content

Windows.Storage.ThumbnailMode is not a WinRT type and makes ThumbnailMode ambiguous with Windows.Storage.FileProperties #25479

Description

@MartinZikmund

Current behavior

Uno declares a public enum Windows.Storage.ThumbnailMode (MusicView, VideosView) in src/Uno.WinRT/Storage/ThumbnailMode.cs. WinRT has no such type: the real one is Windows.Storage.FileProperties.ThumbnailMode, which Uno also ships (generated).

Any file that imports both namespaces and uses ThumbnailMode fails to compile:

error CS0104: 'ThumbnailMode' is an ambiguous reference between 'Windows.Storage.FileProperties.ThumbnailMode' and 'Windows.Storage.ThumbnailMode'

Expected behavior

Compiles, as it does on WinUI, where only Windows.Storage.FileProperties.ThumbnailMode exists. (using Windows.Storage; + using Windows.Storage.FileProperties; is a very common pair, e.g. the WinUI Gallery StoragePickers sample.)

How to reproduce it

  1. Create a net10.0 class library and reference Uno.WinRT 7.0.0-dev.763:
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Uno.WinRT" Version="7.0.0-dev.763" />
  </ItemGroup>
</Project>
  1. Add this file:
using Windows.Storage;
using Windows.Storage.FileProperties;

public class Repro
{
    public ThumbnailMode Mode = ThumbnailMode.PicturesView;
}
  1. dotnet build produces CS0104 (see above).

Workaround

Fully qualify Windows.Storage.FileProperties.ThumbnailMode (or add a using alias) in app code.

Works on UWP/WinUI

Yes. The WinRT metadata has no Windows.Storage.ThumbnailMode; the generated Uno stubs mirror this (Windows.Storage.FileProperties/ThumbnailMode.cs exists, nothing under Windows.Storage/).

Environment

Reproduced by a real build (Uno.WinRT 7.0.0-dev.763 package) and by reading the source on current master (48f3e65).

NuGet package version

Uno.WinRT 7.0.0-dev.763 (also seen with Uno.Sdk 7.0.0-dev.75)

Affected platforms

All (it is a compile-time type collision in Uno.WinRT).

Anything else

Root cause: src/Uno.WinRT/Storage/ThumbnailMode.cs (stray, non-WinRT type).

The only other reference in the repo is src/Uno.WinRT/Storage/StorageFile.cs (GetThumbnailAsync(CancellationToken, ThumbnailMode, ...)), and that code sits inside an #if false block, so the stray enum is unused.

Suggested fix: delete the file. This removes a public type, so it is technically a breaking change, but the type does not exist in WinRT and any consumer using it is already non-portable.

Activity

  1. added
    kind/bug
    good first issue
    triage/untriaged
    area/storage 📦
    project/non-ui ⚙️
    platform/all
    difficulty/starter 🚀
    kind/breaking-change 💥
    on Oct 14, 2026
  2. removed
    triage/untriaged
    on Oct 29, 2026
  3. self-assigned this
    on Nov 3, 2026
  4. added a commit that references this issue on Nov 4, 2026
    8bb04f1
  5. khaskoul commented on Nov 9, 2026

    @khaskoul

    Scope: Windows host, class library. using Windows.Storage; using Windows.Storage.FileProperties; public class Repro { public ThumbnailMode Mode = ThumbnailMode.PicturesView; }.

    Verified fixed on Uno.Sdk 7.0.0-dev.179 (Uno.WinUI 7.1.0-dev.90).

    Environment: Windows 11 Pro (26200), .NET SDK 10.0.401, Uno.Sdk / Uno.Templates 7.0.0-dev.179 (Uno.WinUI 7.1.0-dev.90).

    net10.0 class library with both using Windows.Storage; and using Windows.Storage.FileProperties; and a field ThumbnailMode Mode = ThumbnailMode.PicturesView;:

    Uno.WinUI Result
    7.0.0-dev.2428 error CS0104: 'ThumbnailMode' is an ambiguous reference between 'Windows.Storage.FileProperties.ThumbnailMode' and 'Windows.Storage.ThumbnailMode'
    7.1.0-dev.90 builds, 0 warnings, 0 errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/storage 📦difficulty/starter 🚀good first issuekind/breaking-change 💥kind/bugplatform/allproject/non-ui ⚙️

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions