When publishing .NET Core API services, the output includes with localized resources (cs, de, es, fr, etc.)
Searching for a solution to prevent .NET Core from publishing these localized resource files, I came across this commit on Github to implement SatelliteResourceLanguages
for that purpose.
But how can I implement it?
According to this answer, you should just add it to the project file:
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
Here's how you can use the above line in a project config:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<SatelliteResourceLanguages>en;de;pt</SatelliteResourceLanguages>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FooBar" Version="2.0.1" />
</ItemGroup>
</Project>
Note that I couldn't find SatelliteResourceLanguages
documented officially anywhere as of today.
Also note that you need to have a recent version of the SDK, as this bug report mentions that a typo prevented this to work properly in prior releases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With