claude-code - 💡(How to fix) Fix [BUG] Hallucinated invalid ResizeMode enum value in generated WPF XAML [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55633Fetched 2026-05-03 04:48:23
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

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.

Error Message

Error Messages/Logs

Root Cause

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

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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"
  3. Claude generates the project, runs dotnet build which succeeds
  4. Open in Visual Studio 2022 and press F5
  5. 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

extent analysis

TL;DR

The most likely fix is to update Claude Code to generate valid ResizeMode enum values for WPF projects.

Guidance

  • Verify that the generated MainWindow.xaml file contains an invalid ResizeMode attribute value, which should be one of NoResize, CanMinimize, CanResize, or CanResizeWithGrip.
  • Check the Claude Code version and ensure it is up-to-date, as the issue may have been fixed in a later version.
  • If the issue persists, try manually correcting the ResizeMode value in the generated MainWindow.xaml file to a valid value.
  • Consider reporting the issue to the Claude Code developers with detailed steps to reproduce, as suggested in the issue template.

Example

No code snippet is provided, as the issue is related to the generated XAML file and the fix would depend on the specific Claude Code version and configuration.

Notes

The issue may be specific to the Opus model and .NET 8 WPF projects, and further investigation is needed to determine the root cause and a permanent fix.

Recommendation

Apply a workaround by manually correcting the ResizeMode value in the generated MainWindow.xaml file, as this is a quicker solution than waiting for an update to Claude Code.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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"

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING