apache / logging-log4net

Apache Log4net is a versatile, feature-rich, efficient logging API and backend for .NET
https://logging.apache.org/log4net
Apache License 2.0
849 stars 324 forks source link

Support aot? #147

Closed YahuiWong closed 3 months ago

YahuiWong commented 4 months ago

I publish my dotnet 8 project by aot mode , After that the soft can`t working . and print the err msg

log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
 ---> System.MissingMethodException: No parameterless constructor defined for type 'System.Configuration.ClientConfigurationHost'.
   at System.ActivatorImplementation.CreateInstance(Type, Boolean) + 0x119
   at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[]) + 0x43
   at System.Configuration.ClientConfigurationSystem..ctor() + 0x47
   at System.Configuration.ConfigurationManager.EnsureConfigurationSystem() + 0x56
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationManager.PrepareConfigSystem() + 0x35
   at System.Configuration.ConfigurationManager.GetSection(String) + 0x18
   at System.Configuration.ConfigurationManager.get_AppSettings() + 0x11
   at log4net.Util.SystemInfo.GetAppSetting(String) + 0x21
FreeAndNil commented 4 months ago

@YahuiWong please See #142

YahuiWong commented 4 months ago

@YahuiWong please See #142 @FreeAndNil I do not know,Is https://github.com/apache/logging-log4net/issues/142 have a solution?

FreeAndNil commented 4 months ago

@YahuiWong yes, see my comments and #143

FreeAndNil commented 3 months ago

@YahuiWong please reopen when you have feedback

YahuiWong commented 2 months ago

I have no idea about how to solve it. Is that I reference log4net need use dll files not nuget? @FreeAndNil

FreeAndNil commented 2 months ago

I have no idea about how to solve it. Is that I reference log4net need use dll files not nuget? @FreeAndNil

@YahuiWong yes, you need to build the dll from the sources in the refrenced branch or use these binaries: netstandard2.0.zip