You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "TheSundayDev (via GitHub)" <gi...@apache.org> on 2024/07/13 16:41:02 UTC
[I] log4net in MAUI application (logging-log4net)
TheSundayDev opened a new issue, #153:
URL: https://github.com/apache/logging-log4net/issues/153
Hi all,
I'm migrating from xamarin form to MAUI (ios and android) and one library has log4net as dependency.
I have the exception below.
How can I solve it?
thanks a lot
[DOTNET] log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
[0:] log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
[DOTNET] System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
[DOTNET] ---> System.PlatformNotSupportedException: Operation is not supported on this platform.
[DOTNET] at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
[DOTNET] at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
[DOTNET] at System.Configuration.ClientConfigurationHost.get_ConfigPaths()
[DOTNET] at System.Configuration.ClientConfigurationHost.GetStreamName(String configPath)
[DOTNET] at System.Configuration.ClientConfigurationHost.get_IsAppConfigHttp()
[DOTNET] at System.Configuration.Internal.DelegatingConfigHost.get_IsAppConfigHttp()
[DOTNET] at System.Configuration.ClientConfigurationSystem..ctor()
[DOTNET] at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
[DOTNET] --- End of inner exception stack trace ---
[DOTNET] at System.Configuration.ConfigurationManager.PrepareConfigSystem()
[DOTNET] at System.Configuration.ConfigurationManager.GetSection(String sectionName)
[DOTNET] at System.Configuration.ConfigurationManager.get_AppSettings()
[DOTNET] at log4net.Util.SystemInfo.GetAppSetting(String key)
[0:] System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigurationHost.get_ConfigPaths()
at System.Configuration.ClientConfigurationHost.GetStreamName(String configPath)
at System.Configuration.ClientConfigurationHost.get_IsAppConfigHttp()
at System.Configuration.Internal.DelegatingConfigHost.get_IsAppConfigHttp()
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String key)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] log4net in MAUI application (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil commented on issue #153:
URL: https://github.com/apache/logging-log4net/issues/153#issuecomment-2252852381
@TheSundayDev feel free to reopen when you have more details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] log4net in MAUI application (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil commented on issue #153:
URL: https://github.com/apache/logging-log4net/issues/153#issuecomment-2227211386
@TheSundayDev embedded ressource is wrong. The config file must be copied as is to the target directory (the default build action for config files)
Is the exception still the same?
Can you post your project file?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] log4net in MAUI application (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil commented on issue #153:
URL: https://github.com/apache/logging-log4net/issues/153#issuecomment-2831126224
@TheSundayDev your config file is not well formed (it has more than one root element).
It need to look like this:
```xml
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date| %level | %message%newline" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="ConsoleAppender" />
</root>
</log4net>
</configuration>
```
The `<configuration>` nodes as root was missing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] log4net in MAUI application (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil closed issue #153: log4net in MAUI application
URL: https://github.com/apache/logging-log4net/issues/153
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] log4net in MAUI application (logging-log4net)
Posted by "TheSundayDev (via GitHub)" <gi...@apache.org>.
TheSundayDev commented on issue #153:
URL: https://github.com/apache/logging-log4net/issues/153#issuecomment-2227122521
Thanks for your quick reply!
Reference to System.Configuration.ConfigurationManager added.
I created a app.config file in project root and mark as Embedded resource.
For sure I'm doing something wrong.
Content is
`<?xml version="1.0" encoding="utf-8" ?>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date| %level | %message%newline" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="ConsoleAppender" />
</root>
</log4net>`
thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] log4net in MAUI application (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil commented on issue #153:
URL: https://github.com/apache/logging-log4net/issues/153#issuecomment-2244767256
@TheSundayDev is this issue still relevant?
Otherwise I will close this next week.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] log4net in MAUI application (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil commented on issue #153:
URL: https://github.com/apache/logging-log4net/issues/153#issuecomment-2227037784
@TheSundayDev do you have a config file?
If yes, can you post the content?
If not, can you create one?
Do you have a reference on System.Configuration?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org