-
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
Correct Trimming RootMode for ConfigurationManager #109777
Comments
Tagging subscribers to this area: @dotnet/area-system-configuration |
System.Configuration.ConfigurationManager design is incompatible with trimming. It is not possible to make it work well in trimmed applications. You may want to consider switching to a configuration library that is compatible with trimming such as https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8/runtime#configuration-binding-source-generator . (This is documented at https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/incompatibilities#reflection-based-serializers .) |
Closing; There is some work in v10 on this: #108464 |
Just FYI, the work in #108464 is designed to provide better trim warnings when using ConfigurationManager - not to make it compatible with trimming. |
understood, thanks all 👍 |
Hi there, this is a followup after #101423.
I've rooted ConfigurationManager as described using TrimmerRootAssembly, but dotnet publish says that ConfigurationManager does not specify a RootMode, so I've given
<TrimmerRootAssembly Include="System.Configuration.ConfigurationManager" RootMode="Library" />
.In this mode, I still get the
Unhandled exception. System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
error from #101423.Please could you advise the correct rootmode to use for this package? I haven't been able to find the documentation for
RootMode
online as of yet.Many thanks in advance
(dotnet 8, linux-x64)
The text was updated successfully, but these errors were encountered: