0

I wrote application with Spring.Net. When I try call to GetObject("...") of the Spring.Net I have got an exception:

No object named 'SystemConfiguration_Workspace_NewWorkspaceAction' is defined : Cannot find definition for object [SystemConfiguration_Workspace_NewWorkspaceAction]

But I have object named 'SystemConfiguration_Workspace_NewWorkspaceAction' in my XML.

<?xml version="1.0" encoding="utf-8" ?>
<spring>

<typeAliases>
<alias name="ContextMenuItemModelAlias" type="ElmoMotionControl.View.Model.ContextMenuItemModel, ElmoMotionControl.View.Model"/>
</typeAliases>

<objects xmlns="http://www.springframework.net" >

<!--<description>An example that demonstrates simple IoC features.</description>-->

<object id="WorkspaceTreeModel" type="ElmoMotionControl.View.Model.ContextMenuModel, ElmoMotionControl.View.Model" >
  <property name="ContextMenus" ref="WorkspaceTreeModelDicProp"/>
</object>

<!-- _______________________The dictionary item______________________ -->
<object id ="WorkspaceTreeModelDicProp" type="System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.List&lt;ContextMenuItemModelAlias>>>">
    <constructor-arg>
      <dictionary key-type="string" value-type="System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.List&lt;ContextMenuItemModelAlias>>">
        <entry key="SystemConfiguration_Workspace" value-ref="SystemConfiguration_Workspace"/>
      </dictionary>
    </constructor-arg> 
</object>
.
.
.
</objects>
</spring>

What can be the problem?

Marijn
  • 10,367
  • 5
  • 59
  • 80
Amir Brand
  • 313
  • 1
  • 3
  • 14
  • I only see a `SystemConfiguration_Workspace` and no `SystemConfiguration_Workspace_NewWorkspaceAction` object definition. – Marijn Apr 23 '12 at 12:17
  • Sorry! I tried it with GetObject("WorkspaceTreeModel") and I got the same error (with "WorkspaceTreeModel"). – Amir Brand Apr 23 '12 at 12:25
  • Could it be that `SystemConfiguration_Workspace` has a property or constructor configured to `SystemConfiguration_Workspace_NewWorkspaceAction`, which is missing? – Marijn Apr 23 '12 at 12:39
  • "SystemConfiguration_Workspace" is object in the xml. I want that the Spring.Net will create an instance of that. I don't think that SystemConfiguration_Workspace has a property or constructor configured to SystemConfiguration_Workspace_NewWorkspaceAction, which is missing. – Amir Brand Apr 23 '12 at 13:20
  • In these situations, I often do a "find in solution" with search term "SystemConfiguration_Workspace_NewWorkspaceAction"; just to confirm it isn't referenced anywhere. – Marijn Apr 23 '12 at 13:29
  • Thanks! I don't know what was the problem, but I did class to every level. One class that include List, one class that include dictionary of string and the last class and one class that include string and the last class. It was simplery to create the XML to that classes. Marijn, thank you very very much for your help and for your tolerance. I really appreciate it. – Amir Brand Apr 24 '12 at 06:58

1 Answers1

0

Thanks, I succeed solved my problem

I don't know what was the problem, but I did class to every level.

One class that include List, one class that include dictionary of string and the last class and one class that include string and the last class.

It was simplery to create the XML to that classes.

Amir Brand
  • 313
  • 1
  • 3
  • 14