microsoft / microsoft/microsoft-ui-xaml
XamlCompiler.exe exits with code 1 and produces no output.json for XAML files in Views subfolders
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
**Summary**
When a XAML file is placed in a subfolder under `Views/` (for example `Views/UI/ShellView.repro.xaml`) and contains certain constructs (a `Grid` with attributes such as `Background`), `XamlCompiler.exe` returns exit code 1 and produces no `output.json` (no stderr/stdout diagnostics).
**Repro in this repo**
I prepared a minimal repro in: https://github.com/shamunda/MIID/tree/fix/xaml-compiler-workaround/tools/repro_xaml_compiler_bug
Files: `ShellView.repro.xaml` and `input.json`. Use the platform compiler shipped in the WinUI package to reproduce:
```
"C:\Users\\\.nuget\\packages\\microsoft.windowsappsdk.winui\\1.8.251105000\\tools\\net472\\XamlCompiler.exe" tools/repro_xaml_compiler_bug/input.json tools/repro_xaml_compiler_bug/output.json
```
**Environment**
- Microsoft.WindowsAppSDK.WinUI: 1.8.251105000
- Dotnet SDK pinned to 9.0.301; target `net9.0-windows10.0.22621.0`
**Observed**
- Compiler exits with code 1 and `output.json` is not produced. No stderr/stdout useful diagnostics are emitted.
**Expected**
- Compiler should generate `output.json` the same as when the XAML file is placed in `Views/` root.
**Attachments & notes**
- I collected a process dump for a failing run: `tools/dumps/bisect_views_gridcopy/XamlCompiler.exe_*.dmp` in this repo (I can share the dump if helpful — it is ~6 MB).
- As a temporary workaround in our project, I added an MSBuild target that copies XAML files from subfolders into `Views/` before CoreCompile to sidestep the issue; see commit/branch: https://github.com/shamunda/MIID/tree/fix/xaml-compiler-workaround
Please let me know what additional data or traces would be helpful; I can provide the exact `input.json` and the dump or run further cases and attach results.
Contributor guide
Research direction
Run the supplied XamlCompiler.exe command with tools/repro_xaml_compiler_bug/input.json and compare it with the same XAML placed at the Views/ root. Inspect the referenced XamlCompiler.exe process dump and the repro files, ShellView.repro.xaml and input.json. Done means the compiler exits successfully and produces output.json for XAML files in Views subfolders.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100