【问题标题】:Could not find section 'castle' in the configuration file associated with this domain在与此域关联的配置文件中找不到“城堡”部分
【发布时间】:2011-02-05 09:45:32
【问题描述】:

当我将 Cuyahoga CMS 发布到 localhost 时出现此错误。

我能做什么?我对“城堡”或“城堡.温莎”一无所知。

【问题讨论】:

    标签: c# .net asp.net iis web-config


    【解决方案1】:

    将您的web.config 与 Cuyahoga CMS 中的web.config 进行比较。您的定义缺少项目所依赖的 Castle Windsor IoC 的一些配置部分。喜欢:

    <configuration>
        <configSections>
            <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" />
        </configSections>
    </configuration>
    

    【讨论】:

      【解决方案2】:

      参考This Answer,需要补充:

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

      如果只添加&lt;section name="castle"...,我仍然会出错,我添加&lt;castle&gt;...&lt;/castle&gt;然后错误解决。

      【讨论】:

        【解决方案3】:

        这是您的项目所依赖的程序集(它是一个 IoC 容器,但这无关紧要),它正在寻找您的 web.config 文件中缺少的配置部分。

        您需要正确配置它才能消除错误。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2013-10-03
          • 2020-07-02
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多