-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConfigurationBinder.Bind is not linker friendly #41658
Comments
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. |
Similar to #40551 |
cc @eerhardt |
Duplicate of #40551. Closing. |
Similar but not the same. The other issue there's a type parameter, this is an object parameter. This also isn't about object creation but about the fact that property setters get removed. |
The other issue covers that the whole assembly isn't linker-safe. |
It doesn't call out this problem in the description of the issue. Basically anything that uses config binding is busted in a very specific way (recursive properties or not). |
The second paragraph of #40551 states:
And the title of the issue is "Microsoft.Extensions.Configuration.Binder is not linker-safe". I don't see any reason why we would need to keep 2 issues open to track the same problem. |
If
Configuration.Bind
is called on a type an it is the only method of setting its properties all the properties will be removed at link time and the configuration then will not set for bindruntime/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs
Line 107 in 6072e4d
Repo, link with
<TrimMode>Link</TrimMode>
Will output
0
rather than100
This issue currently occurs for certificates in Kestrel dotnet/aspnetcore#25482 meaning https certs cannot be set via config if ASP.NET Core is trimmed; also for
IdentityServer.Configuration.KeyDefinition
as they both use.Bind(value)
The text was updated successfully, but these errors were encountered: