We deliberately chose NOT to support .NET 4.0 for the web API, because it WebApiRequestLifestyleuses CallContext.LogicalGetData , which behaves differently with .NET 4.0. This behavior is so significantly different that it can cause errors when using nested instances ExecutionContextScopein the background thread and Tasksthat work in parallel.
What has changed in this regard is that, in .NET 4.5, the logical call context demonstrates copy-to-write behavior , which means that when the logical call context is changed from a parallel operation, it does not affect the original operation that generated this parallel operation. In .NET 4.0, any change to the context of a logical call from a parallel operation will be observed from the main operation.
.NET.NET, , ExecutionContextScope ( , -API ), . , , . , , , , . , , , - API .
- , , , . , ( , ). , , .
ExecutionContextScope ( ) , , , .NET 4.0 .NET 4.5.
, , .NET 4.5, , .NET 4.0 . , , , , , , .NET 4.0 , Stackoverflow, Simple Injector, .