温莎城堡NHibernate 工具:值不能为空。参数名称:类类型

发布于 2024-09-09 04:21:49 字数 3592 浏览 1 评论 0原文

您好,我正在尝试将温莎城堡 Nhibernate 设施与流畅的 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>

Hi I am attempting to use Castle windsor Nhibernate Facility with fluent Nhibernate and Im getting the error above, as far as Im aware , I have followed the instructions on setting this up. Has anyone else seen this issue and maybe offer some advice? Thanks

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

Here is the facility 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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情痴 2024-09-16 04:21:49

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

The stack trace says the type defined in the configurationBuilder attribute (FluentNHibernateConfigurationBuilder) is invalid or not found. Double-check the namespace and assembly name.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文