configuration file of castle windsor

半城伤御伤魂 提交于 2019-12-24 03:29:53

问题


that how my config file looklike:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <!--<configSections>
    <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler,Castle.Windsor" />
  </configSections>
  <castle>-->
    <components>
      <component id="BasicElement" service="ClassLibrary1.ISomething, ClassLibrary1"
                 type="ClassLibrary1s.Something, ClassLibrary1"
                 lifestyle="singleton">
      </component>
    </components>
  <!--</castle>-->
</configuration>

when I run my application in F5 i got the error: Configuration system failed to initialize, and the inner exception tells me: Unrecognized configuration section components.

and i see that it consequentially call the file Interception.vshost.exe.Config although that I explicitly asked him to read other file.

please help!!!


回答1:


You've commented out the configSection part and the castle parts leaving just the component section.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler,Castle.Windsor" />
  </configSections>
  <castle>
    <components>
    </components>
  </castle>
</configuration>

If you want a blank castle configuration I would suggest something like the above.



来源:https://stackoverflow.com/questions/14400660/configuration-file-of-castle-windsor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!