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())));
      }

  • 相关阅读:
    git简单介绍
    ssh常用操作
    gentoo emerge简单用法
    golang程序因未知错误崩溃时如何记录异常
    RPC实现原理(HSF、dubbo) 从头开始(一)
    websocket
    tmpfs小结
    CURL常用命令
    SVN命令详解
    3.Linux Shell流程控制
  • 原文地址:https://www.cnblogs.com/idlewater/p/2266645.html
Copyright © 2011-2022 走看看