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

  • 相关阅读:
    hdu 1312 ( Red and Black )
    hdu 1429 ( 胜利大逃亡(续) )
    zjut 小X的苹果
    hdu 1253 ( 胜利大逃亡 )
    许多事
    1198 ( Farm Irrigation )
    hdu 1241 Oil Deposits
    hdu 1242 ( Rescue )
    hdu 1240 ( Asteroids! )
    zoj2966 build the electric system
  • 原文地址:https://www.cnblogs.com/idlewater/p/2266645.html
Copyright © 2011-2022 走看看