I have a C # console project that depends on NHibernate 3.3.2 and ShapArch.NHibernate 2.0.4.628, which was compiled with NHibernate 3.3.1 (as far as I know, I could be wrong, but when I created 2.0.4 the SharpArch project loads NH 3.3.1 via Nuget).
Why does Visual Studio show NHibernate as version 3.3.1.4000 when the referenced dll is 3.3.2.4000? The Specific Version property is set to false for all links. And the version for SharpArch appears in version 2.0.0.0 instead of 2.0.4, which is the file / version of the product.
In the application configuration, I have:
<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>
The application does not load using:
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 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 manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) FileName=NHibernate, Version=3.3.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
I'm not even sure why it is trying to load 3.3.0.4000 when the sharp architecture was compiled with 3.3.1.