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 does not generate public format methods when Public="true" is set #7452

Open
DavidBeh opened this issue Oct 15, 2024 · 1 comment · May be fixed by #7360
Open

ResxSourceGenerator does not generate public format methods when Public="true" is set #7452

DavidBeh opened this issue Oct 15, 2024 · 1 comment · May be fixed by #7360

Comments

@DavidBeh
Copy link

DavidBeh commented Oct 15, 2024

Source Generators

Nuget Package

NuGet Package: Microsoft.CodeAnalysis.ResxSourceGenerator

Version: 3.11.0-beta1.24454.1

Describe the bug

Configuring a Ressource File with Public="true" makes only the getters public (or rather the class is made public, the getters are always public and format methods are always internal)

Steps To Reproduce

Add a ressource file with arguments and configure the analyzer:

...
    <ItemGroup>
        <PackageReference Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="3.11.0-beta1.24454.1">
          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
          <PrivateAssets>all</PrivateAssets>
        </PackageReference>
        <EmbeddedResource Update="**/*.resx" Public="true" EmitFormatMethods="true"/>
    </ItemGroup>
...

Example Ressource string with argument: This {addressType} address does to conform to expected requirements.

Expected behavior

Format Methods are public

Actual behavior

Format Methods are internal

Personal suggestion for fix

Replace internal with public in this line:

@uo1
Copy link

uo1 commented Nov 6, 2024

#7360

@uo1 uo1 marked this as a duplicate of #7535 Jan 17, 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
2 participants