Виндзорский замок и комплекс NHibernate:Значение не может быть нулевым.Имя параметра:Тип класса

StackOverflow https://stackoverflow.com/questions/3224491

Вопрос

Привет, я пытаюсь использовать Castle windsor Nhibernate Facility с fluent 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

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

Это было полезно?

Решение

Трассировка стека указывает тип, определенный в configurationBuilder атрибут (FluentNHibernateConfigurationBuilder) недопустим или не найден.Дважды проверьте пространство имен и имя сборки.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top