That's how it works. RemoveComponent will only remove the component when
it's safe to do so, i.e. no other component depends on it.
Why are you removing the component from the container?
I'm asking because I want to remove that functionality from the
container altogether i.e. not allow to remove components once they are
registered.
On 22/02/2011 9:52 AM, [email protected] wrote:
Hi,
i have a behaviour that is very strange. I use the following to Remove
a registration from the
Container:
if (m_pContainer.Kernel.HasComponent(i_strKey))
{
m_pContainer.Kernel.RemoveComponent(i_strKey);
}
This works in most cases. But sometimes HasComponent is true for the
given i_strKey and i
can see the component when inspecting the Kernel. After the call to
RemoveComponent,
the result is still the same...the component with the i_strKey name is
sill there. So the next time
i want to register a component with the i_strKey name, an exception is
thrown.
Has anyone an idea why this happens and what i can do?
Thanks and Regards
B --
You received this message because you are subscribed to the Google
Groups "Castle Project Users" group.
To post to this group, send email to
[email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Castle
Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.