microsoft / dotnet-framework-docker

The repo for the official docker images for .NET Framework on Windows Server Core.
https://hub.docker.com/_/microsoft-dotnet-framework
MIT License
697 stars 334 forks source link

Are debug NGEN images OK? #573

Open richlander opened 4 years ago

richlander commented 4 years ago

I interrogated .NET Framework 1909 and 1903 images, for 32- and 64-bit.

C:\Users\rich>docker run --rm mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-1909 c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen display | findstr debug
Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a <debug>
System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a <debug>

C:\Users\rich>docker run --rm mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-1909 c:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen display | findstr debug
Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a <debug>
System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a <debug>

C:\Users\rich>docker run --rm mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-1903 c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen display | findstr debug
Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a <debug>
System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a <debug>

C:\Users\rich>docker run --rm mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-1903 c:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen display | findstr debug
Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a <debug>
System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a <debug>
mthalman commented 4 years ago

@nattress - Can you provide some context on what <debug> means and why it would be there for these assemblies and not others?

richlander commented 4 years ago

From @jkotas:

These images are compiled with “optimization off”, e.g. here is a command that creates System.Drawing.dll image.

ngen install /nodependencies /debug System.Drawing.dll

These images are used if you configure VS debugger to disable optimizations for everything, so that the whole framework gets the nicer “optimizations off” debugging experience. Nobody does that (intentionally).

We should not have any of these in the docker images.

richlander commented 4 years ago

We need to find out why this is happening.

mthalman commented 4 years ago

I've logged an internal bug for this work: https://microsoft.visualstudio.com/OS/_workitems/edit/26625219