Repository navigation
PublishAot / PublishSingleFile apps do not automatically strip resx satellite assemblies #127086
Description
Activity
- addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Mar 12, 2026 I think this is slightly backwards - the property should still be honored because it influences which DLLs (including resource DLLs) get passed to the linker.
However, the process that empties the publish dir and copies over the newly-linked native application may need to do additional work to clean up those now-redunfant dlls. I actually think I have a copilot PR either in flight or recently merged for this exact issue.
Reacted by Andy Gocke and Noah GilsonRight, the trick is that all of these assemblies must actually make it to the Native AOT/single file bundling steps, otherwise the information is lost.
The actual bug is that the SDK still produces folders/files afterwards.
Reacted by Noah Gilson- removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Mar 12, 2026 My main question here is if the SDK repo on this branch has flowed a recent enough runtime to actually get the fix
Reacted by Noah Gilsontrue, I just merged in the sdk back into dnup the other day, so lemme check
yes, this run was from your latest PR which was after the newest SDK in main was merged with release/dnup - don't have more time to investigate atm but maybe will do so later
Taking a look at one of those binlogs now - it does appear like the change from that PR is in the targets being used, so there could still be a bug for sure!
EDIT: Looks like this change did remove the satellite resource from this project from set of ResolvedFilesToPublish, but the SDK itself still copies the resources from a project's references over. These other-project resource references don't seem to be inputs to to the ILC invocation, so they (currently) don't seem like they would be inputs into trimming. Need to talk to someone on the runtime to untangle this I think, but I think you were right to reopen this @nagilson.
Reacted by Noah Gilson- addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Apr 17, 2026 dotnet-policy-service commented
on Apr 17, 2026 ContributorMore actionsTagging subscribers to this area: @agocke, @elinor-fung, @VSadov
See info in area-owners.md if you want to be subscribed.Yup, fixed by #127089, thanks!
- removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Jul 1, 2026 - locked and limited conversation to collaborators
on Aug 1, 2026

Summary
When publishing an application with
PublishAot=true,PublishSingleFile=true, or as self-contained, satellite resource assemblies (localized.resources.dllfiles in per-culture folders likecs/,de/,fr/, etc.) are not automatically excluded from the publish output directory. I believe these resources are already embedded in the single-file bundle or are unnecessary alongside a native AOT binary, yet they still appear as loose files in the output. This is confusing and made me think they were not correctly embedded.Users must manually set
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>in their project file to suppress them. This property should not be required — the default behavior forPublishSingleFileandPublishAotscenarios should be to exclude satellite assembly folders from the publish output.SatelliteResourceLanguagesalso does not seem to be properly excluding everything when I set the property - folders are still being generated when I set it toenin the dotnetup publish when I tried to set it locally.Reproduction
<PublishAot>true</PublishAot>that references any NuGet package shipping satellite assemblies (e.g.,System.CommandLine,Spectre.Console).dotnet publish -r win-x64 -c Release.cs/,de/,es/,fr/,it/,ja/,ko/,pl/,pt-BR/,ru/,tr/,zh-Hans/,zh-Hant/), each containing.resources.dllfiles that are unnecessary alongside the native binary.Current behavior
.resources.dllfiles from the project and its NuGet dependencies are still copied to the publish directory as loose files in per-culture subdirectories. They serve no purpose — the native binary does not load them.ExcludeFromSingleFile=true), yet their per-culture folders and.resources.dllfiles are also emitted as loose files in the publish output.In all three cases, the only way I found to suppress the extra output is to manually set this variable, which does not seem to always work:
Expected behavior
SatelliteResourceLanguagesshould not be required. The SDK should automatically suppress satellite assembly output for PublishAot and PublishSingleFile scenarios, since the resources are either embedded or unused.PublishSingleFileandPublishAotshould behave as ifSatelliteResourceLanguagesis set to the project's neutral language (typicallyen), so that no extra per-culture folders are produced in the publish output.Impact
Disk space and artifact bloat
For a project like
dotnetup(PublishAot=true) that referencesSystem.CommandLine,Microsoft.Deployment.DotNet.Releases, andSpectre.Console, the publish output contains 13 language directories × 3.resources.dllfiles = 39 extra files and their parent directories. This bloats CI artifacts and wastes disk space, particularly in constrained environments like cross-build containers.XML documentation files
A related concern: XML documentation files (
.xml) from NuGet packages should also be excluded from publish output by default. These are developer-time assets, not runtime assets, and should not ship in a self-contained or AOT-published app.Related
dotnetupexecutable publish output (Produce AOT, Runtime Specific, Cross Build Executables ofdotnetupsdk#53143), which currently ships 39 unnecessary satellite assembly files per RID alongside the native AOT binary.dotnetup-executable-*artifact containscs/,de/,es/,fr/,it/,ja/,ko/,pl/,pt-BR/,ru/,tr/,zh-Hans/,zh-Hant/folders with satellite.resources.dllfiles that should not be present alongside the native AOT binary. Binlogs are also included in the build artifacts for investigation.