You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Kamil Skalski (Jira)" <ji...@apache.org> on 2022/11/19 12:14:00 UTC

[jira] [Commented] (LOG4NET-611) Failed to create netstandard version of logger

    [ https://issues.apache.org/jira/browse/LOG4NET-611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17636150#comment-17636150 ] 

Kamil Skalski commented on LOG4NET-611:
---------------------------------------

[~nachbarslumpi] I was refreshing the libraries today and switched to stock netstandard2.0 log4net version 2.0.15 and I'm no longer having any issues. I'm not sure if this is thanks to the new version or some other dependencies / app changes in the meantime.

> Failed to create netstandard version of logger
> ----------------------------------------------
>
>                 Key: LOG4NET-611
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-611
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.8
>         Environment: Windows Server 2010 R2
>            Reporter: Andrei Stryia
>            Assignee: Dominik Psenner
>            Priority: Critical
>              Labels: RollingFileAppender
>
> I'm using netstandard version of the logger which is constantly fails wit error:
> {code:java}
> System.MethodAccessException: Attempt by security transparent method 'log4net.Appender.RollingFileAppender.ActivateOptions()' to access security critical method 'System.Threading.Mutex..ctor(Boolean, System.String)' failed.
> Assembly 'log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.
>  at log4net.Appender.RollingFileAppender.ActivateOptions()
>  at Log.CreateTimestampedFileAppender(LoggingSettings settings)
>  at Log.InitForComponent(String componentName, LoggingSettings settings)
> ...
> {code}
> My logger assembly is a netstandard asembly which is using by .net framework console app.
> Error disappears, when I'm replacing log4net netstandard1.3 version by net45-full



--
This message was sent by Atlassian Jira
(v8.20.10#820010)