【问题标题】:NHibernate Version IssueNHibernate 版本问题
【发布时间】:2010-12-09 22:20:39
【问题描述】:

我正在尝试启动并运行一个测试项目。我从这篇文章中获取了大量代码.....

Fluent NHibernate Automap with NHibernate Facility in ASP.NET MVC

问题是我收到以下错误....

无法加载文件或程序集'NHibernate,版本=3.0.0.1001,
文化=中性,PublicKeyToken=aa95f207798dfdb4' 或其之一
依赖关系。定位程序集的清单定义不 匹配程序集引用。 (HRESULT 异常:0x80131040)

我已经从 NHibernate、Castle Project 和 FluentNHibernate 下载了所有最新和最好的。我查看了我在项目中引用的 NHibernate.dll 的版本,它是 3.0.0.400。解决方案在哪里以及为什么抱怨 3.0.0.1001??????

为了将来的使用,如果可能的话,我想知道我如何找出问题所在以及解决方案。

非常感谢,

ETFairfax

更多信息.......

异常详细信息:System.IO.FileLoadException:无法加载文件或 程序集'NHibernate,版本=3.0.0.1001,文化=中性, PublicKeyToken=aa95f207798dfdb4' 或其依赖项之一。这 定位程序集的清单定义与程序集不匹配 参考。 (HRESULT 异常:0x80131040)

来源错误:

Line 45:             if (container == null)
Line 46:             {
Line 47:                 container = new WindsorContainer()
Line 48:                    .Install(
Line 49:                        Configuration.FromAppConfig(),

Source File: C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\Global.asax.cs    Line: 47 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' could not be loaded.


=== Pre-bind state information ===
LOG: User = ETFairfax-TestCompany\ETFairfax
LOG: DisplayName = NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
 (Fully-specified)
LOG: Appbase = file:///C:/Users/Public/Documents/TestCompany/Source/TestCompany.TestModule/MvcApplication2/
LOG: Initial PrivatePath = C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\bin
Calling assembly : ClassLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\web.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
LOG: Attempting download of new URL file:///C:/Users/ETFairfax/AppData/Local/Temp/Temporary ASP.NET Files/root/25bf06cc/f1f41498/NHibernate.DLL.
LOG: Attempting download of new URL file:///C:/Users/ETFairfax/AppData/Local/Temp/Temporary ASP.NET Files/root/25bf06cc/f1f41498/NHibernate/NHibernate.DLL.
LOG: Attempting download of new URL file:///C:/Users/Public/Documents/TestCompany/Source/TestCompany.TestModule/MvcApplication2/bin/NHibernate.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

堆栈跟踪:

[FileLoadException: Could not load file or assembly 'NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +64
   System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
   System.Type.GetType(String typeName) +50
   Castle.Facilities.NHibernateIntegration.NHibernateFacility.RegisterDefaultConfigurationBuilder() +133
   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.Install(IWindsorInstaller[] installers) +268
   MvcApplication2.MvcApplication.InitializeWindsor() in C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\Global.asax.cs:47
   MvcApplication2.MvcApplication.Application_Start() in C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\Global.asax.cs:62

Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955

【问题讨论】:

    标签: nhibernate fluent-nhibernate castle-windsor


    【解决方案1】:

    Fluent 可能是使用比您下载的 NHibernate 组件更新的版本构建的。

    Fluent NHibernate 网站上有一个 Fluent/NH3.0 包。

    http://fluentnhibernate.org/downloads

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-14
      • 2010-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-03
      相关资源
      最近更新 更多