log4net - LogicalThreadContext - and unit test cases

I ended up doing this to get it working:

put this in the TestCleanup() method:

CallContext.FreeNamedDataSlot("log4net.Util.LogicalThreadContextProperties");

So, I can't thank you enough for figuring this out to call FreeNamedDataSlot. This turned me on to my answer that worked for me. Instead of passing in the full namespace of the class, I just had to use the class name:

This was used somewhere deep in my Data Access Layer:

MySession session  = (MySession)System.Runtime.Remoting.Messaging.CallContext.LogicalGetData("MySession");

[TestCleanup]
public void Cleanup()
{
    CallContext.FreeNamedDataSlot("MySession");
}

This worked perfect for me! Hopefully this helps someone else when using Visual Studio's Test environment.