Our WPF application uses Windsor (2.5.2) to provide presenter instances with 
their references etc. We use a kind of plugin architecture which constructs 
presenter instances explicitly calling container.Resolve<TPresenter>() and 
because of this kind of Windsor usage we're also releasing the instance when 
presenter is closed. This worked well until now. We added new presenter 
which does not differ fundamentally from other presenters, but we're getting 
NullReferenceException when the presenter is released from container after 
it's closed.

I tried to go through Windsor source code, but can't figure out what's 
wrong. Obvious thing is that one of the presenter's Burden is broken - it's 
Handler and Instance are null which causes the exception. The stack trace 
looks like this:

System.ArgumentNullException: Hodnota nemůže být NULL.
Název parametru: instance
   v Castle.MicroKernel.Releasers.AllComponentsReleasePolicy.Release(Object 
instance) v 
c:\TeamCity\buildAgent\work\1ab5e0b25b145b19\src\Castle.Windsor\MicroKernel\Releasers\AllComponentsReleasePolicy.cs:řádek
 
53
   v Castle.MicroKernel.Burden.Release(IReleasePolicy policy) v 
c:\TeamCity\buildAgent\work\1ab5e0b25b145b19\src\Castle.Windsor\MicroKernel\Burden.cs:řádek
 
78
   v Castle.MicroKernel.Releasers.AllComponentsReleasePolicy.Release(Object 
instance) v 
c:\TeamCity\buildAgent\work\1ab5e0b25b145b19\src\Castle.Windsor\MicroKernel\Releasers\AllComponentsReleasePolicy.cs:řádek
 
68
   v Castle.MicroKernel.DefaultKernel.ReleaseComponent(Object instance) v 
c:\TeamCity\buildAgent\work\1ab5e0b25b145b19\src\Castle.Windsor\MicroKernel\DefaultKernel.cs:řádek
 
654
   v Castle.Windsor.WindsorContainer.Release(Object instance) v 
c:\TeamCity\buildAgent\work\1ab5e0b25b145b19\src\Castle.Windsor\Windsor\WindsorContainer.cs:řádek
 
809

Is there anything I could try to learn what's causing this problem?

-- 
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.

Reply via email to