[BUG] Hallucinated invalid ResizeMode enum value in generated WPF XAML

Resolved 💬 3 comments Opened May 2, 2026 by DidierFOUR Closed May 6, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Description

When asking Claude Code to generate a .NET 8 WPF project (MVVM architecture),
the generated MainWindow.xaml contained an invalid value for the ResizeMode
attribute, causing a XamlParseException at runtime.

Root cause

The generated MainWindow.xaml contained an invalid value for ResizeMode.
Valid values are only: NoResize, CanMinimize, CanResize, CanResizeWithGrip.

What Should Happen?

Expected behavior

Claude Code should either:

  • Use only valid enum values for WPF properties
  • Verify the project actually launches (not just compiles) when asked to "test"

or "verify"

Environment

  • OS: Windows [10/11]
  • Claude Code version: [run claude --version]
  • .NET SDK: 8.x
  • Visual Studio 2022

Suggestion

For WPF/XAML generation, Claude Code should be more conservative with enum
values, or explicitly validate them against the WPF documentation when uncertain.

Error Messages/Logs

Steps to Reproduce

Steps to reproduce

  1. Run claude in an empty folder
  2. Ask: "Create a .NET 8 WPF project named TodoMini with MVVM architecture,

a TextBox, an Add button, and a ListBox bound to an ObservableCollection"

  1. Claude generates the project, runs dotnet build which succeeds
  2. Open in Visual Studio 2022 and press F5
  3. Application crashes at startup with XamlParseException

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude 1.5354.0 (9a9e3d) 2026-04-29T01:14:34.000Z

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗