Skip to content

.NET Standard compat: Avoid usages of CallContext #2197

@jdom

Description

@jdom

In our .NET Standard solution I temporarily removed the usages of CallContext from our RequestContext class, as it's not supported in .NET Standard. See 772dde7 for the commit where this was excluded.

We need to find an alternative. Without too much investigation on my end, it seems that the recommended alternative is to use AsyncLocal<T> which is available in both .NET Standard and .NET 4.6+. If we go with this approach, we should probably keep this code under conditional compilation for the mean time, as we are not ready to update the dependency for the main solution (non-vNext) to 4.6 just yet (soon though).

In order to open the solution that compiles using .NET Standard (and hence easy to check what is available in that environment), check out this readme

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions