Meziantou.Framework.ResxSourceGenerator 1.0.9

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Meziantou.Framework.ResxSourceGenerator --version 1.0.9                
NuGet\Install-Package Meziantou.Framework.ResxSourceGenerator -Version 1.0.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Meziantou.Framework.ResxSourceGenerator" Version="1.0.9">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Meziantou.Framework.ResxSourceGenerator --version 1.0.9                
#r "nuget: Meziantou.Framework.ResxSourceGenerator, 1.0.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Meziantou.Framework.ResxSourceGenerator as a Cake Addin
#addin nuget:?package=Meziantou.Framework.ResxSourceGenerator&version=1.0.9

// Install Meziantou.Framework.ResxSourceGenerator as a Cake Tool
#tool nuget:?package=Meziantou.Framework.ResxSourceGenerator&version=1.0.9                

Meziantou.Framework.ResxSourceGenerator

Generate code to access the content of resx files. It does provides more methods than the generator provided by Visual Studio. For instance, it parses placeholders in text and provides method


<?xml version="1.0" encoding="utf-8"?>
<root>
  <data name="Hello" xml:space="preserve">
    <value>Hello {0}!</value>
  </data>
</root>
_ = Sample.Hello; // Hello {0}
_ = Sample.FormatHello("meziantou"); // Hello meziantou

The generator also supports binary resources and expose them as byte[].

How to configure the source generator

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    
    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
    <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GeneratedFiles</CompilerGeneratedFilesOutputPath>

    
    <DefaultResourcesNamespace>Sample</DefaultResourcesNamespace>
  </PropertyGroup>

  <ItemGroup>
    
    <PackageReference Include="Meziantou.Framework.ResxSourceGenerator" Version="1.0.0" />

    
    <AdditionalFiles Include="**/*.resx" />

    
    <AdditionalFiles Include="file1.resx" Namespace="CustomNamespace" ClassName="CustomClassName" ResourceName="CustomResourceFileName" />
  </ItemGroup>

</Project>
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.12 46 11/27/2024
1.0.11 85 11/17/2024
1.0.10 463 11/15/2023
1.0.9 453 12/24/2022
1.0.8 365 1/5/2022
1.0.7 310 11/10/2021
1.0.6 376 7/14/2021
1.0.5 368 4/22/2021
1.0.4 360 2/5/2021
1.0.3 365 2/4/2021
1.0.2 365 2/3/2021
1.0.1 391 2/3/2021
1.0.0 508 1/23/2021