Repro
- Install v6.0.100-alpha.1.21062.9 of the SDK from dotnet/installer.
- Create a new blazorwasm project:
dotnet new blazorwasm
- Publish the project with trimming:
dotnet publish -c Release (optionally dump the dependencies with /p:_TrimmerDumpDependencies=true
- Examine the
Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider method in Microsoft.Extensions.DependencyInjection.dll
- See that the call to
RuntimeFeature.IsDynamicCodeCompiled still exists as does the path that invokes new DynamicServiceProviderEngine(services)
Expected behavior
RuntimeFeature.IsDynamicCodeCompiled should be false (it is in the S.P.Corelib assembly) and the code path handling DynamicServiceProviderEngine should have been trimmed.
Actual Behavior
It is not trimmed which is causing System.Reflection.Emit to not be trimmed.