Skip to content

sdk logging is broken #63

@Ben-Holley

Description

@Ben-Holley

In v11.35.1, OneSpanSign.Sdk.Internal.ApplicationLogger no longer seems to work because the trace compiler constant is missing.
I suspect, but did not validate, this setting went missing during the upgrade to netstandard. The visual studio project type for netstandard doesn't have an obvious way to set this, and it seems to be set by default back in the full .net framework days.

According to Microsoft, there are 2 ways to fix the issue:

  1. Adding #define TRACE to OSS SDK code.
  2. specifying the option /d:TRACE when compiling OSS SDK code.

I didn't check the code on versions newer than v11.35.1, because those tags aren't available.

In case you're curious what's going on behind the scenes, here is what ApplicationLogger looks like when decompiled, and TRACE is not defined. Notice all the empty methods.
image

Here is what ApplicationLogger looks like when decompiled, and TRACE is defined. Notice methods arent empty.
image

Here is the quick and dirty fix I used so I could move forward.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions