microsoft / microsoft/microsoft-ui-xaml

WMC9999: MissingManifestResourceException when building WinUI 3 app with dotnet msbuild on non-English Windows

Open
#11,157 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Resources area-XamlCompiler team-Core
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

## Description

Building a WinUI 3 app using `dotnet msbuild` fails with `WMC9999` on non-English
(e.g. Russian) Windows systems. The root cause is a resource name mismatch in
`XamlCompiler.exe` shipped in the `microsoft.windowsappsdk.winui` NuGet package.

## Steps to Reproduce

1. Windows with non-English UI language (tested: Russian / ru-RU)
2. Install .NET 10 SDK
3. Build any WinUI 3 project using `dotnet msbuild` (MSBuildRuntimeType=Core)

## Error

Xaml Internal Error error WMC9999: Could not find any resources appropriate for
the specified culture or the neutral culture. Make sure
"Microsoft.UI.Xaml.Markup.Compiler.ErrorMessages.resources" was correctly
embedded or linked into assembly "XamlCompiler" at compile time.

## Root Cause

In `microsoft.windowsappsdk.winui 2.1.0`, `XamlCompiler.exe` contains class
`Microsoft.UI.Xaml.Markup.Compiler.ErrorMessages` whose `ResourceManager` looks
for resource `Microsoft.UI.Xaml.Markup.Compiler.ErrorMessages.resources` in the
XamlCompiler assembly. However, the embedded resource is still named with the
**old namespace**: `Microsoft.Windows.UI.Xaml.Build.Tasks.ErrorMessages.resources`.

This mismatch is masked on English Windows because `NeutralResourcesLanguageAttribute`
is absent and .NET Framework's neutral-culture fallback silently swallows the error
in that context. On non-English systems the `MissingManifestResourceException`
surfaces as WMC9999.

Note: this only affects `dotnet msbuild` (Core runtime), which uses `XamlCompiler.exe`
as a subprocess (`UseXamlCompilerExecutable=true`). Full Visual Studio is unaffected
because it uses its own XAML compiler host.

## Fix

Two changes needed in `XamlCompiler.exe`:
1. Rename embedded resource from `Microsoft.Windows.UI.Xaml.Build.Tasks.ErrorMessages`
→ `Microsoft.UI.Xaml.Markup.Compiler.ErrorMessages`
2. Add `[assembly: NeutralResourcesLanguage("en-US")]`

## Environment

- Package: `microsoft.windowsappsdk.winui` 2.1.0
- OS: Windows 11 ru-RU
- SDK: .NET 10.0.300
- Build: `dotnet msbuild` (MSBuild 18.6.3)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating XamlCompiler.exe in the microsoft.windowsappsdk.winui package and inspect its embedded resource name and assembly attributes. Reproduce with dotnet msbuild on a non-English Windows system; done means the resource resolves and the WinUI build no longer reports WMC9999.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.