Repository navigation
Westinm/trimming - #2210
Westinm/trimming#2210
Conversation
first pass over code to address trim warnings
β¦ft-identity-web into westinm/trimming
Jean-Marc Prieur (jmprieur)
left a comment
There was a problem hiding this comment.
LGTM
I left a question
We can address it in a later iteration (with .NET 8). But would want to capture that in a work item.
| nameof(ScopeKeySection))); | ||
| } | ||
| string? scopeKeySectionValue = configuration.GetValue<string>(ScopeKeySection); | ||
| string? scopeKeySectionValue = configuration[ScopeKeySection]; |
There was a problem hiding this comment.
Can the section be a single property value? Did you test it?
| /// <param name="services">The services being configured.</param> | ||
| /// <param name="configurationSection">Optional configuration section.</param> | ||
| #if NET6_0_OR_GREATER | ||
| [RequiresUnreferencedCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")] |
There was a problem hiding this comment.
Can we do better in .NET 8? by enabling EnableMicrosoftExtensionsConfigurationBinderSourceGenerator ?
https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8#source-generator-for-configuration-binding
There was a problem hiding this comment.
From what I read, probably. I do want to try this and test it when we add .NET 8.
|
|
||
| <PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0'"> | ||
| <IsTrimmable>true</IsTrimmable> | ||
| </PropertyGroup> |
There was a problem hiding this comment.
Do we also want to try
<EnableMicrosoftExtensionsConfigurationBinderSourceGenerator>true</EnableMicrosoftExtensionsConfigurationBinderSourceGenerator>if we use Microsoft.Extensions.Configuration.Binder NuGet package 8.*?
and then remove the attributes which are due to the binding.
Shall we do that when we enable .NET 8?
jennyf19 Westin Musser (@westin-m) ?
There was a problem hiding this comment.
Let's do that as an increment.
There was a problem hiding this comment.
Yes, I want to try this with .NET 8.
Make IdWeb trimmable. Where possible, change implementations to be trim-friendly. Otherwise, bubble-up the warnings to Apps calling our library. More info on trimming is here.
Published File Size in KB Using the 4-1-MyOrg Sample (.net7)