You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting null reference exception for a child container when trying to resolve a disposable service.
The exception has happened in this code:
[MethodImpl((MethodImplOptions)256)]internalvoidAddUnorderedDisposable(IDisposabledisposable){// e is nullvare=_disposables.GetEntryOrDefault(0);varitems=e.Value;//<-- raises the exceptionif(Interlocked.CompareExchange(refe.Value,items.Push(disposable),items)!=items)Ref.Swap(refe.Value,disposable,(x,d)=>x.Push(d));}
Due debugging I figured out that this code is invoked:
publicvirtualIScopeClone(boolwithDisposables)=>!withDisposables?newScope(_maps.CopyNonEmpty(),_used,ImMap<ImList<IDisposable>>.Empty)// dropping the disposables:newScope(_maps.CopyNonEmpty(),_used,_disposables);
Dropping the disposables create an empty map. In contrast in other places I can see a different code:
ImMap.Entry(0,ImList<IDisposable>.Empty)
instead of
ImMap<ImList<IDisposable>>.Empty
like in this code:
publicoverrideIScopeClone(boolwithDisposables)=>!withDisposables?newWithParentAndName(Parent?.Clone(withDisposables),Name,_maps.CopyNonEmpty(),_used,ImMap.Entry(0,ImList<IDisposable>.Empty))// dropping the disposables:newWithParentAndName(Parent?.Clone(withDisposables),Name,_maps.CopyNonEmpty(),_used,_disposables);// Не забыть скопировать папу (коментарий для дочки)// Надеюсь вы не забыли скопировать папу ;-)
DryIoc.dll: Version=5.3.1
.net core 6
The text was updated successfully, but these errors were encountered:
I am getting null reference exception for a child container when trying to resolve a disposable service.
The exception has happened in this code:
The child container is created by this code:
Due debugging I figured out that this code is invoked:
Dropping the disposables create an empty map. In contrast in other places I can see a different code:
instead of
like in this code:
DryIoc.dll: Version=5.3.1
.net core 6
The text was updated successfully, but these errors were encountered: