You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently don't do anything to clean up intermediate build artifacts following a build. However, running dotnet publish produces several unused build artifacts that are copied/duplicated to the bin/publish folders users will use.
In many cases this has a relatively small impact on the output footprint. However, the impact can be quite significant in certain cases -- especially when the source includes large files that are copied to the output directory, or when compiling self-contained and/or AOT apps.
The number of unused/duplicated files can be reduced by setting the artifacts path property during the build. Setting the artifacts path to a /tmp/foo folder, in combination with the PublishDir msbuild property, effectively eliminates most of the duplication.
Users can already configure this by including a Directory.Build.props file similar to this:
The difference in disk usage (with and without artifacts path configured to a tmp directory) can be seen for a couple template webapiaot and blazor apps below.
We currently don't do anything to clean up intermediate build artifacts following a build. However, running
dotnet publish
produces several unused build artifacts that are copied/duplicated to thebin/publish
folders users will use.In many cases this has a relatively small impact on the output footprint. However, the impact can be quite significant in certain cases -- especially when the source includes large files that are copied to the output directory, or when compiling self-contained and/or AOT apps.
The number of unused/duplicated files can be reduced by setting the artifacts path property during the build. Setting the artifacts path to a
/tmp/foo
folder, in combination with thePublishDir
msbuild property, effectively eliminates most of the duplication.Users can already configure this by including a
Directory.Build.props
file similar to this:The difference in disk usage (with and without artifacts path configured to a tmp directory) can be seen for a couple template
webapiaot
andblazor
apps below.We may want to consider setting the artifacts path by default for all builds (by setting the
--artifacts-path
parameter duringdotnet publish
).The text was updated successfully, but these errors were encountered: