Nhibernate visual studio.Net中显示的dll版本不反映引用的dll文件/产品版本
我有一个控制台应用程序c#项目,它依赖于NHibernate 3.3.2和ShapArch.NHibernate 2.0.4.628,这是用NHibernate 3.3.1编译的(据我所知,我可能错了,但当我创建了一个2.0.4 SharpArch项目时,它通过Nuget下载了NH3.3.1) 当引用的dll为3.3.2.4000时,为什么Visual Studio将NHibernate显示为版本3.3.1.4000?所有引用的特定版本属性都设置为false。SharpArch的版本出现在VS 2.0.0.0中,而不是文件/产品版本的2.0.4 在应用程序配置中,我有:Nhibernate visual studio.Net中显示的dll版本不反映引用的dll文件/产品版本,nhibernate,c#-4.0,sharp-architecture,Nhibernate,C# 4.0,Sharp Architecture,我有一个控制台应用程序c#项目,它依赖于NHibernate 3.3.2和ShapArch.NHibernate 2.0.4.628,这是用NHibernate 3.3.1编译的(据我所知,我可能错了,但当我创建了一个2.0.4 SharpArch项目时,它通过Nuget下载了NH3.3.1) 当引用的dll为3.3.2.4000时,为什么Visual Studio将NHibernate显示为版本3.3.1.4000?所有引用的特定版本属性都设置为false。SharpArch的版本出现在VS
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.2.4000" />
</dependentAssembly>
</assemblyBinding>
</runtime>
我甚至不知道,当sharp architecture使用3.3.1编译时,它为什么要加载3.3.0.4000。NHibernate 3.3.2.GA有一个文件版本的3.3.2.4000,但汇编版本仍然是3.3.1.4000。这样做是为了在不需要绑定重定向的情况下升级NHibernate。NHibernate未来的所有次要版本升级也将遵循此模式 因此,您的解决方案就是删除绑定重定向
令人困惑的是,Windows资源管理器仅显示文件和产品版本,而Visual Studio仅显示程序集版本。希望有人创建一个VS扩展以在属性列表中显示文件版本。目前,我将始终使用.net reflector,它始终显示版本和版本dll所依赖的dll的
System.IO.FileLoadException was unhandled
Message=Could not load file or assembly 'NHibernate, Version=3.3.2.4000, 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)
Source=MyApp.ResourcesGenerator
FileName=NHibernate, Version=3.3.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
FusionLog=""
StackTrace:
at MyApp.ResourcesGenerator.Program.InitializeNHibernateSession()
at SharpArch.NHibernate.NHibernateInitializer.InitializeNHibernateOnce(Action initMethod) in d:\Builds\SharpArch2\Solutions\SharpArch.NHibernate\NHibernateInitializer.cs:line 54
at MyApp.ResourcesGenerator.Program.Initialize() in C:\projects\tc\Trunk\Source_LibsUpgrade\Applications\PerformanceManagement\MyApp.ResourcesGenerator\Program.cs:line 149
at MyApp.ResourcesGenerator.Program.Main(String[] args) in C:\projects\tc\Trunk\Source_LibsUpgrade\Applications\PerformanceManagement\MyApp.ResourcesGenerator\Program.cs:line 31
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.FileLoadException
Message=Could not load file or assembly 'NHibernate, Version=3.3.0.4000, 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)
FileName=NHibernate, Version=3.3.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4