From 903eebb644527360cb34195e1106dc94fe91c5e2 Mon Sep 17 00:00:00 2001 From: Alan McGovern Date: Wed, 16 Apr 2014 17:54:08 -0400 Subject: Disable the context of CallContext as it doesn't work the way we need We're more than happy with a single static variable. We don't support multiple appdomains (or want to support it), and our usage of async/await does not work with CallContext under .NET 4.5. We end up getting a null value from CallContext.GetData after an await completes, which is expected behaviour. --- src/framework/Internal/TestExecutionContext.cs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/framework/Internal/TestExecutionContext.cs b/src/framework/Internal/TestExecutionContext.cs index 9796cdc..340b4f2 100755 --- a/src/framework/Internal/TestExecutionContext.cs +++ b/src/framework/Internal/TestExecutionContext.cs @@ -239,13 +239,8 @@ namespace NUnit.Framework.Internal /// /// The current context, head of the list of saved contexts. /// -#if SILVERLIGHT || NETCF -#if (CLR_2_0 || CLR_4_0) && !NETCF - [ThreadStatic] -#endif - private static TestExecutionContext current; -#endif + private static TestExecutionContext current; /// /// Gets the current context. /// @@ -254,14 +249,10 @@ namespace NUnit.Framework.Internal { get { -#if SILVERLIGHT || NETCF if (current == null) current = new TestExecutionContext(); return current; -#else - return CallContext.GetData("NUnit.Framework.TestContext") as TestExecutionContext; -#endif } } @@ -271,11 +262,7 @@ namespace NUnit.Framework.Internal internal static void SetCurrentContext(TestExecutionContext ec) { -#if SILVERLIGHT || NETCF current = ec; -#else - CallContext.SetData("NUnit.Framework.TestContext", ec); -#endif } #endregion -- cgit v1.2.3