Meziantou.Framework.ResxSourceGenerator 1.0.7

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

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

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

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.
  • net5.0

    • No dependencies.
  • net6.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 338 11/15/2023
1.0.9 420 12/24/2022
1.0.8 337 1/5/2022
1.0.7 279 11/10/2021
1.0.6 348 7/14/2021
1.0.5 330 4/22/2021
1.0.4 330 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 483 1/23/2021