In an attempt to resolve this question, I'm taking a look at how our spring.net configuration works.
The root problem comes from this snippet:
<object name="someObject" singleton="false" type="SomeType.someObject, SomeAssembly">
<constructor-arg name="authSession">
<object type="Spring.Objects.Factory.Config.PropertyRetrievingFactoryObject, Spring.Core">
<property name="TargetObject" ref="AuthSessionManager" />
<property name="TargetProperty" value="CurrentAuthSession" />
</object>
</constructor-arg>
</object>
In a case where a user is not logged in, AuthSessionManager.CurrentAuthSession
will be null. When that is the case, Spring.NET throws an exception: "Factory object returned null object".
How can I tell Spring that the null object is acceptable in this case?