0

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?

Nebojsa Veron
  • 1,545
  • 3
  • 19
  • 36
  • Are you sure that the objects were disposed in 2.5.3? Structure map do not dispose the objects unless you call `ObjectFactory.ReleaseAndDisposeAllHttpScopedObjects()`. See [this question](http://stackoverflow.com/questions/5015354/structuremap-disposing-of-datacontext-object) and other related questions. – PHeiberg Aug 16 '11 at 14:14
  • Yeah, they were disposed. I found a bug. Those classes were in another project still referencing 2.5.3. It works fine now. :) – Nebojsa Veron Aug 16 '11 at 14:21

1 Answers1

1

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

Nebojsa Veron
  • 1,545
  • 3
  • 19
  • 36