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

  • Home
  • SEARCH
  • 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

I'm using Castle Windsor to do some dependency injection, specifically I've abstracted the DAL
I'm using castle windsor for a pet-project I'm working on. I'm starting to notice
I'm using Castle Windsor and Binsor to use dependency injection in my application. I'm
I've got a pretty basic question about how to start using Castle Windsor. I've
I am using windsor castle as my IoC container, and has run in to
I have been using Castle MonoRail for the last two years, but in a
I am working on a project using Castle Active Record. I stumbled across the
I decided to make a system for a client using Castle ActiveRecord , everything
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.

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.