I want to store logging context information in TLS so that I can set a value at the entry point, and have that value available in all resulting stacks. This work well, but I als
I found another solution to the problem that doesn't require code. I was able to use CallContext to attach data to a "logical thread". This data is transferred from the starting thread to threads generated by TPL as well as the ThreadPool.
http://www.wintellect.com/CS/blogs/jeffreyr/archive/2010/09/27/logical-call-context-flowing-data-across-threads-appdomains-and-processes.aspx