Gengis
02-20-2007, 04:55 PM
Hello,
I have 5 projets and a context for each of them.
I use all of these projects in a "asp.net web application", I load the context as follow (in the web.config)
<spring>
<context>
<resource uri="assembly://[assembly1]/[Path]/context.xml"/>
<resource uri="assembly://[assembly2]/[Path]/context.xml"/>
<resource uri="assembly://[assembly3]/[Path]/context.xml"/>
<resource uri="assembly://[assembly4]/[Path]/context.xml"/>
<resource uri="assembly://[assembly5]/[Path]/context.xml"/>
</context>
</spring>
But I have a name conflicts because of two objects with the same id (one in the context.xml of assembly1, one in the context.xml of assembly2). Each context is 100% autonomous and does not depend on others. When I only load a single assembly (=> 1 context) everything works fine.
Name conflict results with "invalid type" injection.
How can I solve such conflicts ? Is it possible to declare dependencies with a 'lookup scope', which meaning would be "look for dependencies in". So I can tell to spring "resolve dependencies by only looking in the assembly".
Thanks,
PS : I load the context as follow : ContextRegistry.GetContext()
I have 5 projets and a context for each of them.
I use all of these projects in a "asp.net web application", I load the context as follow (in the web.config)
<spring>
<context>
<resource uri="assembly://[assembly1]/[Path]/context.xml"/>
<resource uri="assembly://[assembly2]/[Path]/context.xml"/>
<resource uri="assembly://[assembly3]/[Path]/context.xml"/>
<resource uri="assembly://[assembly4]/[Path]/context.xml"/>
<resource uri="assembly://[assembly5]/[Path]/context.xml"/>
</context>
</spring>
But I have a name conflicts because of two objects with the same id (one in the context.xml of assembly1, one in the context.xml of assembly2). Each context is 100% autonomous and does not depend on others. When I only load a single assembly (=> 1 context) everything works fine.
Name conflict results with "invalid type" injection.
How can I solve such conflicts ? Is it possible to declare dependencies with a 'lookup scope', which meaning would be "look for dependencies in". So I can tell to spring "resolve dependencies by only looking in the assembly".
Thanks,
PS : I load the context as follow : ContextRegistry.GetContext()