Skip to content

Regex Generators fail to build with WPF #60257

@myblindy

Description

@myblindy

Version Used:

VS 17.2 Preview 2

Steps to Reproduce:

Clone https://github.com/myblindy/RegexGeneratorWpfIssue and try to build.

The error message is:

error CS8795: Partial method 'S.CompactAtaRegex()' must have an implementation part because it has accessibility modifiers.

Notes:

  • I have double checked that the regex generator output is correct, including the class names and namespace names and everything. In fact pressing F12 on the partial function name takes you directly to the sourcegen output.
  • I have tried enabled the IncludePackageReferencesDuringMarkupCompilation flag that was supposed to let source generators bypass WPF, but that didn't fix the issue.
  • Interestingly enough, if you remove the <support:IntNullableHasValue x:Key="IntNullableHasValue"/> line from App.xaml (ie all resource references), the source generator output gets compiled again and the problem disappears.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions