Repository navigation
Description
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
- Create a
net10.0class library and referenceUno.WinRT7.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>- Add this file:
using Windows.Storage;
using Windows.Storage.FileProperties;
public class Repro
{
public ThumbnailMode Mode = ThumbnailMode.PicturesView;
}dotnet buildproduces 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
fix(storage)!: Remove the stray Windows.Storage.ThumbnailMode
khaskoul commentedon Nov 9, 2026
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;andusing Windows.Storage.FileProperties;and a fieldThumbnailMode Mode = ThumbnailMode.PicturesView;: