If you do not use it with inspectors, this should be safe, but if you do not use Remoting or cross the border of the AppDomain, then it is probably easier to just use a static stream field. Put a ThreadStaticAttribute in a static field and this will be a separate storage location in each thread.
If you are trying to set values ββin IDispatchMessageInspector , for example, then this will not work, as they will be executed in a separate thread from the request. See OperationContext for information on a specific WCF request call. You can add extensions to it that can store user data by implementing IExtension<OperationContext> and adding them to the Extensions property. Here is a blog post that describes how to add user data to an OperationContext.
Quartermeister
source share