A set of .NET tools that converts a Resx code into C# code.
A .NET library that converts a Resx code into C# code.
This library can be installed through NuGet - http://nuget.org/packages/ResxToCs.Core.
Coming soon…
A .NET Core CLI tool that converts the .resx
files to the .Designer.cs
files.
This tool can be installed through NuGet - http://nuget.org/packages/dotnet-resx2cs. Installation of this package should be done by adding the following code into .csproj
file:
<ItemGroup>
<DotNetCliToolReference Include="dotnet-resx2cs" Version="…" />
</ItemGroup>
In simplest case, you just need to add the following code into .csproj
file:
<Target Name="СonvertResxToCs" BeforeTargets="BeforeCompile">
<Exec Command="dotnet resx2cs" />
</Target>
If your .resx
files are outside the project, then you can specify a another directory by using the following command:
dotnet resx2cs my-resource-directory
A MSBuild task that converts the .resx
files to the .Designer.cs
files.
This tool can be installed through NuGet - http://nuget.org/packages/ResxToCs.MSBuild.
In simplest case, you do not need to do anything. But if your .resx
files are outside the project, then you need to first disable the default target:
<PropertyGroup>
…
<DisableDefaultResxToCsConversionTarget>true</DisableDefaultResxToCsConversionTarget>
…
</PropertyGroup>
Then add a new target and explicitly specify the value of InputDirectory
property:
<Target Name="СonvertResxToCs" BeforeTargets="BeforeCompile">
<ResxToCsTask InputDirectory="my-resource-directory" />
</Target>
See the changelog.