Search code examples
dependency-injectionscopeinversion-of-controlstructuremaphttpcontext

Structure Map 2.6.2 scoping


I'm moving my application from Structure Map 2.5.3 to 2.6.2 and I'm having some scoping problems.

In 2.5.3 version I used CacheBy(InstanceScope.HttpContext) to have instances disposed at the end of Http request. Now in 2.6.2 I tried both HybridHttpOrThreadLocalScoped and HttpContextScoped but my injected instances do not get disposed.

Any solutions?


Solution

  • Those classes which were not disposed were in another project still referencing 2.5.3. It works fine now after fixing the references :)