Fix size regression in DependencyInjection (#56843)
authorEric Erhardt <eric.erhardt@microsoft.com>
Wed, 4 Aug 2021 20:06:41 +0000 (15:06 -0500)
committerGitHub <noreply@github.com>
Wed, 4 Aug 2021 20:06:41 +0000 (15:06 -0500)
commit3eeee42e18c911bac7728b899874a28b0d389eaa
treed25139087dba25f55f6b459cde80f5b4de9745e3
parent7d76a64bd922ca34dc17224001d7e505c914ba6c
Fix size regression in DependencyInjection (#56843)

With the new 6.0 TFM, we are no longer checking IsDynamicCodeCompiled to fall back to Reflection on Blazor WASM. Thus we are now using IL Ref Emit on WASM.

The issue was the #ifs were no longer correct for the new TFM. I've made the #ifs consistent across DI and DI.Abstractions such that the #ifs are for old TFMs and any new TFM will use the #else block.

Fix #56779
src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ActivatorUtilities.cs
src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteRuntimeResolver.cs
src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionResolverBuilder.cs
src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ILEmit/ILEmitResolverBuilder.cs
src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/StackGuard.cs
src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs