When using OData along with NLog.Web there is an error thrown when matching route constraints, on creating a request container.
Error says, that request container is already created. It seems that NLog is getting route data multiple times, and Match method cannot be called that way.
Assemblies affected
System.Web.OData 6.1
Reproduce steps
Use NLog.Web along logging along with OData. My case was logging a warning inside OAuth auth handler.
When using OData along with
NLog.Web
there is an error thrown when matching route constraints, on creating a request container. Error says, that request container is already created. It seems that NLog is getting route data multiple times, andMatch
method cannot be called that way.Assemblies affected
System.Web.OData 6.1
Reproduce steps
Use
NLog.Web
along logging along withOData
. My case was logging a warning inside OAuth auth handler.Error is thrown in this specific place of code: https://github.com/OData/WebApi/blob/master/src/System.Web.OData/OData/Routing/ODataPathRouteConstraint.cs#L119
Expected result
I guess it should get already created container, and create one if not found.
Actual result
Throws error that request container is already created.