0

嗨,我正在尝试将 Castle windsor Nhibernate Facility 与流利的 Nhibernate 一起使用,并且我收到了上述错误,据我所知,我已按照说明进行设置。有没有其他人看到这个问题并可能提供一些建议?谢谢

Value cannot be null.
Parameter name: classType
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: classType

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: classType]
   Castle.MicroKernel.DefaultKernel.AddComponent(String key, Type serviceType, Type classType, LifestyleType lifestyle, Boolean overwriteLifestyle) +191
   Castle.MicroKernel.DefaultKernel.AddComponent(String key, Type serviceType, Type classType, LifestyleType lifestyle) +48
   Castle.MicroKernel.DefaultKernel.AddComponent(String key, Type serviceType, Type classType) +45
   Castle.Facilities.NHibernateIntegration.NHibernateFacility.RegisterDefaultConfigurationBuilder() +154
   Castle.Facilities.NHibernateIntegration.NHibernateFacility.RegisterComponents() +29
   Castle.Facilities.NHibernateIntegration.NHibernateFacility.Init() +196
   Castle.MicroKernel.Facilities.AbstractFacility.Init(IKernel kernel, IConfiguration facilityConfig) +61
   Castle.MicroKernel.DefaultKernel.AddFacility(String key, IFacility facility) +182
   Castle.Windsor.WindsorContainer.AddFacility(String key, IFacility facility) +49
   Castle.Windsor.Installer.DefaultComponentInstaller.SetUpFacilities(IConfiguration[] configurations, IWindsorContainer container) +242
   Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store) +89
   Castle.Windsor.WindsorContainer.RunInstaller() +76
   Castle.Windsor.WindsorContainer..ctor(IConfigurationInterpreter interpreter) +144
   KingMaker.Web.Windsor.ContainerBuilder.Build(String config) +90
   KingMaker.Web.MvcApplication.InitializeWindsor() +74
   KingMaker.Web.MvcApplication.Application_Start() +55

这是设施 xml 设施

<facility
        id="nhibernatefacility"
        type="Castle.Facilities.NHibernateIntegration.NHibernateFacility, Castle.Facilities.NHibernateIntegration"
  isWeb="true"
        configurationBuilder="App.Web.Maps.FluentNHibernateConfigurationBuilder, App.Web">

  <!-- configuration here is overriden by the FluentNHibernateConfigurationBuilder -->
  <factory id="sessionFactory1">
    <settings>
      <item key="connection.provider">NHibernate.Connection.DriverConnectionProvider</item>
      <item key="connection.driver_class">NHibernate.Driver.SqlClientDriver</item>
      <item key="connection.connection_string">Data Source=localhost\sqlexpress;Initial Catalog=FIDPortal;Integrated Security=SSPI</item>
      <item key="dialect">NHibernate.Dialect.MsSql2005Dialect</item>
      <item key="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</item>
    </settings>
    <!--        <assemblies>-->
    <!--          <assembly>Castle.Facilities.NHibernateIntegration.Tests</assembly>-->
    <!--        </assemblies>-->
  </factory>
</facility>

4

1 回答 1

1

堆栈跟踪表明configurationBuilder属性 (FluentNHibernateConfigurationBuilder) 中定义的类型无效或找不到。仔细检查命名空间和程序集名称。

于 2010-07-11T20:44:50.577 回答