From 9fafb4da8f18a4c3b84ca3581871a78d8818b92c Mon Sep 17 00:00:00 2001 From: Rik Svendsen Rose Date: Wed, 25 Nov 2020 12:09:28 +0100 Subject: [PATCH] Change frameworks to net45;netstandard2.0;net5.0 #564 --- .../Castle.Facilities.Logging.csproj | 2 +- .../Castle.Windsor.Tests.csproj | 4 ++-- .../CircularDependencyTestCase.cs | 2 +- src/Castle.Windsor/Castle.Windsor.csproj | 22 +++++++++++++------ .../Scoped/CallContextLifetimeScope.cs | 11 +++++----- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj b/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj index 732f96107c..f75e62b098 100644 --- a/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj +++ b/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj @@ -1,7 +1,7 @@  - net45;netstandard1.6 + net45;netstandard2.0;net5.0 diff --git a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj index fd144919ff..b946ef01fb 100644 --- a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj +++ b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj @@ -1,7 +1,7 @@  - net45;netcoreapp1.0 + net45;net5.0 @@ -56,7 +56,7 @@ - + diff --git a/src/Castle.Windsor.Tests/CircularDependencyTestCase.cs b/src/Castle.Windsor.Tests/CircularDependencyTestCase.cs index 16e6fe5e8c..0687af8bd6 100644 --- a/src/Castle.Windsor.Tests/CircularDependencyTestCase.cs +++ b/src/Castle.Windsor.Tests/CircularDependencyTestCase.cs @@ -146,7 +146,7 @@ public string Path { get { - var uriPath = new Uri(typeof(AssemblyPath).GetTypeInfo().Assembly.CodeBase); + var uriPath = new Uri(typeof(AssemblyPath).GetTypeInfo().Assembly.Location); return uriPath.LocalPath; } } diff --git a/src/Castle.Windsor/Castle.Windsor.csproj b/src/Castle.Windsor/Castle.Windsor.csproj index 401f95a1e4..17b63aeb37 100644 --- a/src/Castle.Windsor/Castle.Windsor.csproj +++ b/src/Castle.Windsor/Castle.Windsor.csproj @@ -1,7 +1,7 @@  - net45;netstandard1.6 + net45;netstandard2.0;net5.0 @@ -33,10 +33,18 @@ - - - - - - + + + + + + + + + + + + + + diff --git a/src/Castle.Windsor/MicroKernel/Lifestyle/Scoped/CallContextLifetimeScope.cs b/src/Castle.Windsor/MicroKernel/Lifestyle/Scoped/CallContextLifetimeScope.cs index 8c02b2421a..baf99b7292 100644 --- a/src/Castle.Windsor/MicroKernel/Lifestyle/Scoped/CallContextLifetimeScope.cs +++ b/src/Castle.Windsor/MicroKernel/Lifestyle/Scoped/CallContextLifetimeScope.cs @@ -120,18 +120,17 @@ private static void SetCurrentScope(CallContextLifetimeScope lifetimeScope) [SecuritySafeCritical] public static CallContextLifetimeScope ObtainCurrentScope() { + object scopeKey; #if FEATURE_REMOTING - var scopeKey = CallContext.LogicalGetData(callContextKey); + scopeKey = CallContext.LogicalGetData(callContextKey); #else - var scopeKey = asyncLocal.Value; + scopeKey = asyncLocal.Value; #endif - if (scopeKey == null) + if (!(scopeKey is Guid)) { return null; } - - CallContextLifetimeScope scope; - allScopes.TryGetValue((Guid)scopeKey, out scope); + allScopes.TryGetValue((Guid)scopeKey, out var scope); return scope; } }