zoukankan      html  css  js  c++  java
  • Castle Windsor的MVC3的例子在最新版本(3.0Beta)上编译不过去的解决办法

    编译不过去的代码:

      public void Install(IWindsorContainer container, IConfigurationStore store)
      {
       container.Register(AllTypes.FromThisAssembly()
                           .BasedOn<IController>()
                           .If(Component.IsInSameNamespaceAs<HomeController>())
                           .If(t => t.Name.EndsWith("Controller"))
                           .Configure((c => c.LifeStyle.Transient)));
      }

    提示信息:

    错误 1 只有 assignment、call、increment、decrement 和 new 对象表达式可用作语句 *******\ControllersInstaller.cs 21 50 ******

    修改成这个样子即可:

      public void Install(IWindsorContainer container, IConfigurationStore store)
      {
       container.Register(AllTypes.FromThisAssembly()
                           .BasedOn<IController>()
                           .If(Component.IsInSameNamespaceAs<HomeController>())
                           .If(t => t.Name.EndsWith("Controller"))
                           .Configure((c => c.LifestyleTransient())));
      }

  • 相关阅读:
    04_web基础(六)之请求转发与重定向
    04_web基础(五)之cookie与session
    04_web基础(四)之servlet详解
    04_web基础(三)之进一步理解web
    04_web基础(二)之web构建
    本地密码提取工具-LAZAGNE
    免杀工具汇总
    流量取证-提取文件
    CA证书安装以及sslh协议转发
    ssh 端口转发
  • 原文地址:https://www.cnblogs.com/idlewater/p/2266645.html
Copyright © 2011-2022 走看看