microsoft / microsoft/microsoft-ui-xaml

Specific line-break placement in the xaml Resources causes XamlCompiler error WMC0610: The XAML Binary Format (XBF) generator reported syntax error '0xc00cee23'

Open
#11,560 3 comments 0 reactions 0 assignees View on GitHub
area-Parser area-XamlCompiler bug team-Core
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

`XamlCompiler` reports `WMC0610` when a resource declared after `ResourceDictionary.MergedDictionaries` uses a very specific line-break arrangement.

The following XAML reproduces the issue:

```xml






```
I got the extremely cryptic error message `WMC0610 ` from the xaml compiler reports:

```text
XamlCompiler error WMC0610: The XAML Binary Format (XBF) generator reported syntax error '0xc00cee23'
```

### Why is this important?

The issue depends on **both** of the following formatting conditions:

```xml

```

1. There must be **no line break** between:

```xml

```

Changing either line break causes the XAML to compile successfully.

For example, adding a line break before `` compiles successfully:

```xml







```

Likewise, keeping the elements adjacent but moving `x:Name` onto the same line also compiles successfully:

```xml






```

Therefore, these semantically equivalent XAML documents produce different XBF compiler results solely because of whitespace placement.

### Steps to reproduce the bug

## Steps to reproduce the bug

1. Create a WinUI 3 project.
2. Add an empty resource dictionary at `Themes/Generic.xaml`.
3. Add the following XAML to a `Page`:

```xml






```

4. Build the project.

The build fails with:

```text
XamlCompiler error WMC0610: The XAML Binary Format (XBF) generator reported syntax error '0xc00cee23'
```

5. Change either of the two relevant line breaks:

* insert a line break between `` and ``, or
* remove the line break between `
```

causes:

```text
WMC0610: The XAML Binary Format (XBF) generator reported syntax error '0xc00cee23'
```

Changing either line break makes the error disappear.

This appears to be a whitespace-sensitive parsing or XBF generation issue rather than an invalid XAML construct.

### Expected behavior

Whitespace and line-break placement between XML elements and attributes should not affect the semantics of the XAML.

All of the following forms should produce the same result:

```xml

```

```xml

```

```xml

```

At minimum, the XBF generator should not enter a syntax-error state based only on this formatting difference.

### Screenshots

Image

Image

### NuGet package version

2.4.0

### Windows version

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure in a WinUI 3 project with the provided Page.Resources XAML and build it with NuGet package version 2.4.0. Trace the XamlCompiler/XBF generation path for the two line-break conditions; done means all three equivalent formatting variants compile without WMC0610.

Written by the indexing model from the issue text.

Assessment

Tech stack
xml
Domain
build-system, compilers, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.