所有我可以在網上搜索使用指定由XmlApplicationContext(sFileName)將讀取的xml上下文定義文件的格式是什麼?
contextToGetSprungObjects = ContextRegistry.GetContext(contextname)
我想用
contextToGetSprungObjects = new XmlApplicationContext(sXmlFileName)
(我打電話到DLL中檢索到的上下文定義的App.Config中模式(例需要Spring.net)從另一個可執行文件(MsWord),所以app.config的方法是)。我試圖偷偷在MyDll.dll.config ..沒有飛。 關於使用XmlApplicationContext方法從指定的XML文件中讀取它,我收到以下錯誤
{"Error registering object with name '' defined in 'file [D:\\Work\\Seven\\WordAutomation\\ContentControls\\WordDocument1\\bin\\debug\\MyWPFPlotPopup.dll.config]' : There is no parser registered for namespace ''\r\n<configSections><sectionGroup name=\"spring\"><section name=\"context\" type=\"Spring.Context.Support.ContextHandler, Spring.Core\" /></sectionGroup><section name=\"log4net\" type=\"log4net.Config.Log4NetConfigurationSectionHandler, log4net\" /></configSections>"}
這使我相信,這兩種方法需要他們的XML不同形狀的瓶子。我搜索了高和低,但所需的XML的架構迴避我..我能找到的一切使用X.exe.config或Web.config。有人能指出我對Spring.net有效的xml上下文定義嗎?
<spring>
<context>
<context name="MyApplication">
<resource uri="file://Resources/MyApplicationContext.xml"/>
</context>
</context>
</spring>
我覺得這是我想對Spring.net重新進行添加
我本來期望的XmlApplicationContext文檔(或任何一般這樣的解析器類)有某種聯繫或指針,以文件的形式,預計。一個例子也可以滿足由於缺乏對這篇文章的回覆。我會說一羣人會從中受益 – Gishu 2009-01-05 06:13:19