Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 991149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:03:43+00:00 2026-05-16T06:03:43+00:00

When I have resolved a component using container.Resolve(), and I have finished using it,

  • 0

When I have resolved a component using container.Resolve(), and I have finished using it, should I call Release()?

At the moment I call Dispose on any IDisposable that the container has got for me. Should I not call Dispose() on the object, but instead call Release() on the container instead? Does it do the same thing?

Thanks

David

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:03:44+00:00Added an answer on May 16, 2026 at 6:03 am

    Short answer:

    • Release what you Resolve (explicitly, or implicitly – via typed factory)
    • Dispose what you create and own. (and you don’t own what container creates, so don’t dispose it – container will).

    Long answer: I wrote a blogpost going into more details

    The documentation on lifestyles goes into more depth as well

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Castle wiki says at several places I should ALWAYS call container.Release() for components
I have a problem that I can't resolve. Let's say I have this map
I have a wrapper managed application(.net) over a COM Component(created using vb6) where Com
Using Castle Windsor as my IoC container and NHibernate I have the following registration:
Currently I have my spring application wired up using @Autowired, @Component, @Resource etc. Now
I'm using ASP.NET MVC with Castle Windsor as my IoC container with the component
Using Castle Windsor, I have a component configured with the transient lifestyle: <component id=publish.mapping.default
We code in C# using VS2008 SP1. We have a server that runs Team
UPDATE: I have somewhat resolved the issue. Just in case if anyone runs in
I have asked this question ever before and it seems I didn't 100% resolved

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.