0

我用 Spring.Net 编写了应用程序。当我尝试调用 Spring.Net 的 GetObject("...") 时,我遇到了一个异常:

未定义名为“SystemConfiguration_Workspace_NewWorkspaceAction”的对象:找不到对象 [SystemConfiguration_Workspace_NewWorkspaceAction] 的定义

但是我的 XML 中有名为“SystemConfiguration_Workspace_NewWorkspaceAction”的对象。

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

可能是什么问题?

4

1 回答 1

0

谢谢,我成功解决了我的问题

我不知道是什么问题,但我上过各个级别的课程。

一类包括List,一类包括字符串字典和最后一类,一类包括字符串和最后一类。

为这些类创建 XML 很简单。

于 2012-04-24T08:48:50.170 回答