Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResxSourceGenerator creates invalid "Format method" name when resource name contains invalid characters #7536

Open
Andrzej-W opened this issue Jan 19, 2025 · 0 comments

Comments

@Andrzej-W
Copy link

NuGet Package: Microsoft.CodeAnalysis.ResxSourceGenerator

Version: 3.11.0-beta1.24605.2

Describe the bug

Resource name can contain characters which are invalid in C# identifier. Generator does not change them to underscores in Format methods.

Steps To Reproduce

Create resource name with invalid characters, for example Name.with.dots. Enable Format methods in project file:

  <ItemGroup>
    <EmbeddedResource Update="**/*.resx">
      <EmitFormatMethods>true</EmitFormatMethods>
    </EmbeddedResource>
  </ItemGroup>

Expected behavior

Format method should have the name FormatName_with_dots

Actual behavior

Format method have the name FormatName.with.dots

Andrzej-W added a commit to Andrzej-W/roslyn-analyzers that referenced this issue Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant