Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to publish a .NET Core application in English only?

I publish my app with the following command: dotnet publish -c Debug -r linux-arm. It works fine, however, it generates folders for languages I don't need.

There are these 3 files in each folder: Microsoft.Data.Edm.resources.dll, Microsoft.Data.OData.resources.dll, System.Spatial.resources.dll.

I do not use these DLLs at all.

Furthermore, the language folders are not there if I publish for Windows. Only for Linux-arm.

How do I just limit the publish to English?

enter image description here

like image 313
AngryHacker Avatar asked Nov 16 '22 21:11

AngryHacker


1 Answers

Refer MSBuild properties

Add the line <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages> in to the property group in your project file. For example,

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net6.0</TargetFramework>
        <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages> 
   </PropertyGroup>
like image 104
shr Avatar answered Nov 19 '22 23:11

shr