When I tried to write some simple sample code I ran into an inconsistency between the Documentation and the actually implementation.
In section "5.4.2. The prototype scope" the documentation says to use the following example to make a prototype scoped object:
Whenever I set the scope attribute to "prototype" I received the following error:Code:<object id="exampleObject" type="Examples.ExampleObject, ExamplesLibrary" scope="prototype"/>
Looking a little deeper into the config validation code, I saw that this is coming back from a XML schema validation check. The XML schema has the following comment on the scope attribute for an obLine 5 in XML document from file [C:\\Projects\\Tools\\SpringTest\\SpringTest\\bin\\ Debug\\Spring.config] violates the schema. The 'scope' attribute is invalid - The value 'Prototype' is invalid according to its datatype 'String' - The Enumeration constraint failed.
I was able to get it working by not using the scope parameter at all and setting the singleton parameter to "false".Optional attribute controlling the scope of singleton instances. It is
only applicable to ASP.Net web applications and it has no effect on prototype
objects. Applications other than ASP.Net web applications simply ignore this attribute.
It has 3 possible values:
Default object scope. Objects defined with application scope will behave like
traditional singleton objects. Same instance will be returned from every call
Objects with this scope will be stored within user's HTTP session. Session scope
is typically used for objects such as shopping cart, user profile, etc.
Object with this scope will be initialized for each HTTP request, but unlike with prototype
objects, same instance will be returned from all calls to IApplicationContext.GetObject()
within the same HTTP request. For example, if one ASP page forwards request to another using
Server.Transfer method, they can easily share the state by configuring dependency to the same
I was unable to find a place to submit issues with the documentation, so i figured I should post it here.