Skip to content

Is <GenerateSource> publicly supported for generating a class to access string resources from .resx files? #115115

Answered by huoyaoyuan
jonsagara asked this question in Q&A
Discussion options

You must be logged in to vote

It's an internal process: https://github.com/dotnet/arcade/blob/main/src/Microsoft.DotNet.Arcade.Sdk/tools/GenerateResxSource.targets

The is a Visual Studio feature to generate code file for resx:

  <ItemGroup>
    <Compile Update="Test.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Test.resx</DependentUpon>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="Test.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Test.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>

This dotnet runtime repos are having a command line version of it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jonsagara
Comment options

Answer selected by jonsagara
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants