-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add a template for RESX files #739
Comments
It may be a bit more complicated than this as you also want a corresponding *.Designer.cs file, and you need to make some updates to the project file: <ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Update="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup> |
I'd prefer we not encourage that mode of C#-from-resx codegen, in favor of the MSBuild one that works outside of VS. |
Microsoft also has a source generator that can generate the code (C#, VB, F#). This has the benefit of not having to mention the resx files in the project files at all. Also the generated code is nullable aware which the code generated by |
It should be possible to create a new RESX resource file from the command line.
Note that the default template in Visual Studio includes a large comment and XSD. These are not required. A minimal template would contain:
The text was updated successfully, but these errors were encountered: