dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

CLI files layout includes "ref" directories that aren't required and add to size on disk/installer time #16197

Closed DamianEdwards closed 3 years ago

DamianEdwards commented 3 years ago

The CLI layout on disk after installation includes numerous ref directories. None of these, as far as I can tell, are required but were included because one is produced by default in build output since .NET 5 and thus they get included in the overall CLI layout.

We should look at tweaking the build properties to remove these directories as they simply add to the install time and on disk footprint of the CLI.

C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9> Get-ChildItem -Directory -Recurse -Filter ref | Select-Object -Property FullName

FullName
--------
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\ref
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\DotnetTools\dotnet-watch\6.0.100-preview.3.21153.5\tools\net6.0\any\ref
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\Microsoft\Microsoft.NET.Build.Extensions\tools\net6.0\ref
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\Sdks\Microsoft.NET.Sdk\tools\net6.0\ref
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\tools\net6.0\ref
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\Sdks\Microsoft.NET.Sdk.Publish\tools\net6.0\ref
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\Sdks\Microsoft.NET.Sdk.Razor\tasks\net6.0\ref
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\Sdks\Microsoft.NET.Sdk.Web\tools\net6.0\ref
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\Sdks\Microsoft.NET.Sdk.Web.ProjectSystem\tools\net6.0\ref
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9\Sdks\Microsoft.NET.Sdk.Worker\tools\net6.0\ref

C:\Program Files\dotnet\sdk\6.0.100-preview.3.21153.9>

Note that changing the default for exe outputs to not produce a ref dir is being considered for .NET 6 https://github.com/dotnet/sdk/issues/16193

dotnet-issue-labeler[bot] commented 3 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

wli3 commented 3 years ago

That should be easy to implement. Just find all projects to set ProduceReferenceAssembly to false. Meanwhile redist project has it set already

We might want to do https://github.com/dotnet/sdk/issues/16193 instead

marcpopMSFT commented 3 years ago

For 6.0.100, we should not include these in the sdk install. Separately, we should discuss not including them in the bin directory output at all on a build and the repercussions of that change.

marcpopMSFT commented 3 years ago

Adding this to the SDK product size .net 7 idea document and closing.