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 152087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:33:39+00:00 2026-05-11T09:33:39+00:00

Using Castle Windsor, I have a component configured with the transient lifestyle: <component id=publish.mapping.default

  • 0

Using Castle Windsor, I have a component configured with the transient lifestyle:

<component id='publish.mapping.default'                    service='IMyService, MyAssembly'                    type='MyServiceImplementation, Myassembly'                     lifestyle='transient' /> 

Which will be used like this:

var service = container.Resolve<IMyService>(componentId); // service usage .... // service goes out of scope ...  

My question is, will the service instance be garbage collected after it goes out of scope, or will Castle Windsor hold on to a reference ? I found this similar question, that implies that the latter might be the case – but after examining the links posted there, I am unsure whether the discussion is about holding on to the reference, or about ensuring that the object are disposed if it implements IDisposable. My objects does not need to be disposed.

If Castle Windsor holds on to the instance, is there any easy way to prevent this (perhaps by configuration) ?

EDIT
It seems, that I need to set the release tracking policy. Can this be configured in the xml config file, or does it need to be set in code ? Can the release tracking policy be set on a per-component basis ?

  • 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. 2026-05-11T09:33:39+00:00Added an answer on May 11, 2026 at 9:33 am

    By default, the container holds a reference to your objects (even the transient ones).

    However, as @Bittercoder notes in Why does Castle Windsor hold onto transient objects?, you can change the release tracking policy. It seems that choosing

    LifecycledComponentsReleasePolicy:

    var policy = container.Kernel.ReleasePolicy; container.Kernel.ReleasePolicy = LifecycledComponentsReleasePolicy; 

    But since the question was asked, that appears to have become the default policy.

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

Sidebar

Related Questions

Using Castle Windsor, I want to configure a generic service with a type parameter;
I'm using Castle Windsor 3.0. I have a component that should be started automatically
I am using Castle Windsor for IoC, and have the configuration held in the
I have the following mapping in my Castle Windsor xml file which has worked
I have successfully setup castle windsor using an xml configuration file and everything works
I have begun using Castle Windsor and somehow my app is all up and
I'm using ASP.NET MVC with Castle Windsor as my IoC container with the component
I have a Castle Windsor component, that depends on a string. The string needs
I've only just started using Castle Windsor recently and have a question. Suppose I
I'm currently using Castle Windsor v2.5.1 and running into a few issues. I have

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.