Merge remote-tracking branch 'origin/v8/dev' into v8/feature/10613-distributed-locks
This commit is contained in:
@@ -346,6 +346,8 @@ namespace Umbraco.Core.Scoping
|
||||
|
||||
if (this != _scopeProvider.AmbientScope)
|
||||
{
|
||||
var failedMessage = $"The {nameof(Scope)} {this.InstanceId} being disposed is not the Ambient {nameof(Scope)} {(_scopeProvider.AmbientScope?.InstanceId.ToString() ?? "NULL")}. This typically indicates that a child {nameof(Scope)} was not disposed, or flowed to a child thread that was not awaited, or concurrent threads are accessing the same {nameof(Scope)} (Ambient context) which is not supported. If using Task.Run (or similar) as a fire and forget tasks or to run threads in parallel you must suppress execution context flow with ExecutionContext.SuppressFlow() and ExecutionContext.RestoreFlow().";
|
||||
|
||||
#if DEBUG_SCOPES
|
||||
var ambient = _scopeProvider.AmbientScope;
|
||||
_logger.Debug<Scope>("Dispose error (" + (ambient == null ? "no" : "other") + " ambient)");
|
||||
@@ -357,7 +359,7 @@ namespace Umbraco.Core.Scoping
|
||||
+ "- ambient ctor ->\r\n" + ambientInfos.CtorStack + "\r\n"
|
||||
+ "- dispose ctor ->\r\n" + disposeInfos.CtorStack + "\r\n");
|
||||
#else
|
||||
throw new InvalidOperationException("Not the ambient scope.");
|
||||
throw new InvalidOperationException(failedMessage);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Web;
|
||||
@@ -240,6 +241,9 @@ namespace Umbraco.Core.Scoping
|
||||
var value = GetHttpContextObject<ScopeContext>(ContextItemKey, false);
|
||||
return value ?? GetCallContextObject<ScopeContext>(ContextItemKey);
|
||||
}
|
||||
|
||||
[Obsolete("This setter is not used and will be removed in future versions")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
set
|
||||
{
|
||||
// clear both
|
||||
|
||||
Reference in New Issue
Block a user