Meziantou.Framework.ResxSourceGenerator 1.0.10

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Meziantou.Framework.ResxSourceGenerator --version 1.0.10
NuGet\Install-Package Meziantou.Framework.ResxSourceGenerator -Version 1.0.10
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.10">
  <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.10
#r "nuget: Meziantou.Framework.ResxSourceGenerator, 1.0.10"
#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.10

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

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.
  • net8.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.10 331 11/15/2023
1.0.9 418 12/24/2022
1.0.8 336 1/5/2022
1.0.7 278 11/10/2021
1.0.6 347 7/14/2021
1.0.5 329 4/22/2021
1.0.4 329 2/5/2021
1.0.3 333 2/4/2021
1.0.2 336 2/3/2021
1.0.1 360 2/3/2021
1.0.0 482 1/23/2021