Cannot serialize the aspects: Cannot find a serializer for type 'log4net.Core.LogImpl'

rshankar's Avatar

rshankar

17 Oct, 2017 12:15 PM

I am trying to use Log4net for logging the details of the execution time.

I have [NonSerialized] attribute added to public ILog Log = LogManager.GetLogger(typeof(LoggingFilterAttribute)), still getting error "Cannot serialize the aspects: Cannot find a serializer for type 'log4net.Core.LogImpl'"

  1. 1 Posted by rshankar on 17 Oct, 2017 12:33 PM

    rshankar's Avatar

    I am getting error in Web Api controller where I am using the attribute.

  2. Support Staff 2 Posted by PostSharp Techn... on 18 Oct, 2017 04:09 PM

    PostSharp Technologies's Avatar

    Hello,

    You need to mark your field with the [PNonSerialized] attribute instead. It's an equivalent of [NonSerialized] and is used in classes marked as [PSerializable].

    -alex

  3. Support Staff 3 Posted by PostSharp Techn... on 06 Nov, 2017 01:42 PM

    PostSharp Technologies's Avatar

    Hello,

    We are going to close this request as there have not been any further updates. Please feel free to reopen the discussion if you need more help.

    Thanks,
    PostSharp Team

  4. PostSharp Technologies closed this discussion on 06 Nov, 2017 01:42 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac