Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-611

Failed to create netstandard version of logger

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Abandoned
    • 2.0.8
    • None
    • Core
    • Windows Server 2010 R2

    Description

      I'm using netstandard version of the logger which is constantly fails wit error:

      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)
      ...
      

      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

      Attachments

        Issue Links

          Activity

            People

              nachbarslumpi Dominik Psenner
              andrei_s Andrei Stryia
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: