Closed schuettecarsten closed 3 years ago
Thanks for sharing this! I hope it'll reveal some more info, in the meantime I'm going to investigate around as well.
Catched it.
Object reference not set to an instance of an object.
at Stashbox.ResolutionScope.Resolve(Type typeFrom, Boolean nullResultAllowed, Object[] dependencyOverrides) in D:\Projekte\Azure\CloudManagementTool\Source\SharedLibrary\Neusta.Shared.ObjectProvider.Stashbox\Stashbox\src\ResolutionScope.Resolver.cs:line 26
delegateCache
was null. Looks like DelegateCacheProvider.GetNamedCache
sometimes returns null
, which it should not.
Thanks for the info, glad you found it! I'm going to dig into the issue.
Wasn't able to repro, but added an extra check just to be sure that it can't return null. It'll be available in the latest pre-release package within some minutes. I know it comes very rarely, but could you please give it a try? Thanks!
I will update my code and let you know.
When I looked into the code, I found the method ImmutableTree.GetOrDefault
with aggressive inlining and a parameter byRef
with a default value. I am a bit unsure about this, so I think it would be better (and faster at runtime) to create two methods: GetOrDefaultByValue
and GetOrDefaultByRef
that cover the specific situation.
There are some more methods in ImmutableTree
that have a byRef
parameter, but as they are not agressively inlined, that should be fine.
Thanks! For the suggestions also, I'll do the split and measure the results.
Sometimes, under very rare circumstances that I cannot reproduce, I get a NullReferenceException when Resolve method is called.
I have integrated the latest version of Stashbox source code into my code directly and hope to get more details on this exception asap.