10

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

AngryHacker
  • 59,598
  • 102
  • 325
  • 594
  • Are you using any other dependencies that might be introducing localization? I just tested that exact same command on one of my ASP.NET Core MVC projects without getting any of the localized folders. Maybe something like a Telerik or DevExpress would introduce those? – Collin Barrett Nov 19 '18 at 19:55
  • @CollinM.Barrett I just checked and the languages only appear if I publish for linux-arm. If I publish for Windows, the languages are not there. I also updated the question to list the files that are in the folders. – AngryHacker Nov 19 '18 at 21:49
  • 2
    Does this answer your question? [ASP.Net Core exclude published language directories other than english](https://stackoverflow.com/questions/60330650/asp-net-core-exclude-published-language-directories-other-than-english) – kofifus Feb 21 '20 at 02:40

1 Answers1

6

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>
shr
  • 875
  • 10
  • 20