我用Spring.Net編寫了應用程序。當我嘗試打電話給GetObject的(「...」)的Spring.Net的我有一個例外:彈簧投擲錯誤找不到對象的定義
定義沒有名爲‘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<string, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<ContextMenuItemModelAlias>>>">
<constructor-arg>
<dictionary key-type="string" value-type="System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<ContextMenuItemModelAlias>>">
<entry key="SystemConfiguration_Workspace" value-ref="SystemConfiguration_Workspace"/>
</dictionary>
</constructor-arg>
</object>
.
.
.
</objects>
</spring>
可能是什麼問題?
我只看到一個'SystemConfiguration_Workspace'而沒有'SystemConfiguration_Workspace_NewWorkspaceAction'對象定義。 – Marijn 2012-04-23 12:17:08
對不起!我試着用GetObject(「WorkspaceTreeModel」) 和我得到了同樣的錯誤(與「WorkspaceTreeModel」)。 – 2012-04-23 12:25:02
難道這是'SystemConfiguration_Workspace'有一個屬性或構造函數配置爲'SystemConfiguration_Workspace_NewWorkspaceAction',這是丟失? – Marijn 2012-04-23 12:39:40