Alistair Evans

Results 82 comments of Alistair Evans

Possibly, but I should point out that the code above doesn't depend on any Autofac internals I believe, so you should just be able to bring that middleware code into...

Yeah, I think the reason I didn't pursue it further was that it was indeed a bit...janky. But yes, init-only properties "just work" in Autofac if you set `PropertiesAutowired`. I...

This is an interesting use-case, albeit one we don't actually support; I've always really struggled to get an ALC to _actually_ unload personally, they're usually pretty stubborn. It's certainly not...

I'm not opposed to supporting some way of clearing internal caches. Scenarios where Autofac supports a plugin architecture, and the ability to load plugins is a pretty common usecase. Unloading...

I'm reasonably confident (80%?) that if a lifetime scope is configured in `BeginLifetimeScope` using the callback, then a new `ScopeRestrictedRegisteredServicesTracker` (derived from `DefaultRegisteredServicesTracker` is created), which ensures that any singletons...

As you say, we are absolutely not going to get involved in figured out how to "drain" the resolver. But, worth noting that if someone disposes the outer lifetime scope...

You point about `GetOrAdd` is accurate, clearing the cache isn't going to break any in-progress resolves (but might slow them down). But Autofac cannot _guarantee_ the cache will be cleared...

Are you saying that you are finding references still left behind _inside Autofac_ when unloading? Or more generally in your app?

Okay; let us know what you find. I've got a PR ready-to-go with the `ReflectionCache.Clear` changes, but I'm reluctant to add that if it doesn't actually solve the problem of...

> I'm reasonably confident (80%?)... See, this is why I'm pleased I gave myself 20% leeway to be wrong. 🤦‍♂️ _Instances_ of the types themselves from `nested` are not held...