dotnet / dotnet/maui

Platform-specific (Windows) ResourceDictionary cannot align partial classes

Open
#33,555 2 comments 0 reactions 0 assignees View on GitHub
area-xaml platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

### Description

When trying to add a new .NET MAUI Resource Dictionary (XAML) to an existing .NET MAUI App, the project no longer compiles and the new dictionary throws errors: XLS0414 and CS10103.

### Steps to Reproduce

Using Visual Studio 2026, version 18.1.1:
1. Create a new project of type .NET MAUI App - named MyMauiApp.
3. Verify the freshly created solution builds without error.
4. Navigate the solution explorer to MyMauiApp>Platforms>Windows
5. Create a new item **> .NET MAUI ResourceDictionary (XAML)** - called MyDictionary.xaml.
6. Build the solution
7. Experience a build error as follows:
`XLS0414 The type 'MyMauiApp.Platforms.Windows.MyDictionary' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. MyMauiApp C:\Users\JohnK\source\repos\MyMauiApp\Platforms\Windows\MyDictionary.xaml 4`

Observe the IntelliSense disliking the code in 2 areas, the MyDictionary.xaml and MyDictionary.xaml.cs

Image

Image

Expect the solution to build without errors.

### Link to public reproduction project repository

_No response_

### Version with bug

10.0.0

### Is this a regression from previous behavior?

Not sure, did not test other versions

### Last version that worked well

Unknown/Other

### Affected platforms

Windows

### Affected platform versions

DOTNET version 10.0.101, Windows 11 24H2 (26100.7623)

### Did you find any workaround?

No

### Relevant log output

```shell
1>------ Build started: Project: MyMauiApp, Configuration: Debug Any CPU ------
1>Build started 1/15/2026 9:08:06 PM.
1> 1>CopyFilesToOutputDirectory:
1> MyMauiApp -> C:\Users\JohnK\source\repos\MyMauiApp\bin\Debug\net10.0-ios\iossimulator-x64\MyMauiApp.dll
1> 1>CopyFilesToOutputDirectory:
1> MyMauiApp -> C:\Users\JohnK\source\repos\MyMauiApp\bin\Debug\net10.0-android\MyMauiApp.dll
1> 1>CopyFilesToOutputDirectory:
1> MyMauiApp -> C:\Users\JohnK\source\repos\MyMauiApp\bin\Debug\net10.0-maccatalyst\maccatalyst-x64\MyMauiApp.dll
1> 1>C:\Users\JohnK\source\repos\MyMauiApp\Platforms\Windows\MyDictionary.xaml(2,2): XamlCompiler error WMC0001: Unknown type 'ResourceDictionary' in XML namespace 'http://schemas.microsoft.com/dotnet/2021/maui'
1>
1>Build FAILED.
1>
1> "C:\Users\JohnK\source\repos\MyMauiApp\MyMauiApp.csproj" (build target) (1) ->
1> "C:\Users\JohnK\source\repos\MyMauiApp\MyMauiApp.csproj" (Build target) (1:5) ->
1> (MarkupCompilePass1 target) ->
1> C:\Users\JohnK\source\repos\MyMauiApp\Platforms\Windows\MyDictionary.xaml(2,2): XamlCompiler error WMC0001: Unknown type 'ResourceDictionary' in XML namespace 'http://schemas.microsoft.com/dotnet/2021/maui'
1>
1> 0 Warning(s)
1> 1 Error(s)
1>
1>Time Elapsed 00:00:01.64
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 9:08 PM and took 02.170 seconds ==========

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure in the .NET MAUI App described, then inspect Platforms/Windows/MyDictionary.xaml and MyDictionary.xaml.cs alongside the project build configuration. Check why the Windows-specific ResourceDictionary is not recognized by XAML compilation or aligned with its partial class. Done means the new dictionary builds without XLS0414, CS10103, or WMC0001 errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.