8

In ASP.NET Core 6 when publishing as a self contained win-x86 website a bunch of language folders are created in the publish folder.

enter image description here

These folders contain a single dll which is System.Private.ServiceModel.resources.dll. These folders where not present with Asp.NET 5 as best I can tell and they add clutter/noise to the deployment that I'd prefer not to have.

Can you explain why all these localized versions of the System.Private.ServiceModel.resources.dll are needed for such a deployment? Also since my website is only in English, can I safely delete all the language folders (ie. cs, de, es, fr, it, ja, ko, pl, pt-BR, ru, tr, zh-Hans, zh-Hant)? Lastly, is there a better way to make these go away? Some configuration someplace for example?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
RonC
  • 31,330
  • 19
  • 94
  • 139

1 Answers1

19

You can add SatelliteResourceLanguages to limit the folders.

<PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
Peter Csala
  • 17,736
  • 16
  • 35
  • 75
Edison Silva
  • 314
  • 2
  • 2
  • 2
    Do you happen to know the documentation for this change? In .NET 5 the `dotnet publish` command was not creating these folders. – Valuator Jan 03 '22 at 22:23