Problem running latest version of nhibernate - nhibernate

I downloaded latest version of NHibernate “2.1.0.2002”.
It built fine, but when I run my unit tests, I keep getting error :-
System.IO.FileLoadException: Could not load file or assembly 'NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
It looks like somewhere it looks of old version.
Here is link
https://stackoverflow.com/questions/839112/problem-while-migrating-nhibernate-to-higher-version
This is internal error I am getting:
=== Pre-bind state information ===
LOG: DisplayName = NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
(Fully-specified)
LOG: Appbase = file:///D:/Project Files/CIS3G/Webapp/_Test_DAL/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : CIS3G.DAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Project Files\CIS3G\Webapp\_Test_DAL\bin\Debug\_Test_DAL.dll.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
LOG: Attempting download of new URL file:///D:/Project Files/CIS3G/Webapp/_Test_DAL/bin/Debug/NHibernate.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Please check if you set the Specific Version-Property on your NHibernate Reference to 'true'? It doesn't seem to be the case on this error but with new NHibernate you need to provide an external ByteCodeProvider like Linfu.dll as well. Please check this also.

I've run into this before.
In my case the problem was that I was using a UnitOfWork implementation for handling Nhibernate sessionFactories.
I've been using this lib for a while so I just copied the compiled dll to a new test project with the new version of NHibernate, so I got the version problem.

Related

i am getting configuration error after svn checkout .using VS 2022

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: An error occurred creating the configuration section handler for system.web.webPages.razor/host: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 4:
Line 5:
Line 6:
Line 7:
Line 8:
Source File: E:\eSTEM\estem\Coding\src\WebApi\views\web.config Line: 6
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///E:/eSTEM/estem/Coding/src/WebApi/
LOG: Initial PrivatePath = E:\eSTEM\estem\Coding\src\WebApi\bin
Calling assembly : (Unknown).
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\eSTEM\estem\Coding\src\WebApi\web.config
LOG: Using host configuration file: C:\Users\Hstpl\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/Hstpl/AppData/Local/Temp/Temporary ASP.NET Files/vs/dd21db9b/d3877c96/System.Web.WebPages.Razor.DLL.
LOG: Attempting download of new URL file:///C:/Users/Hstpl/AppData/Local/Temp/Temporary ASP.NET Files/vs/dd21db9b/d3877c96/System.Web.WebPages.Razor/System.Web.WebPages.Razor.DLL.
LOG: Attempting download of new URL file:///E:/eSTEM/estem/Coding/src/WebApi/bin/System.Web.WebPages.Razor.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.9037.0
i have tried to run the project

System.IO.FileLoadException: Could not load file or assembly 'IBM.Data.DB2'

I am currently working on Outlook 2013 Addin Projects using visual studio 2013 and Visual Basic .Net. However, when I try to connect to DB2 Database. It shows that the dll files that I added into the project reference cannot be loaded.
What I do is add a new panes with a button in outlook which will look a windows form in outlook when the button is clicked. Onload the form, it will connect to DB2 and the below error message occur
System.IO.FileLoadException: Could not load file or assembly 'IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
File name: 'IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208'
=== Pre-bind state information ===
LOG: DisplayName = IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208
(Fully-specified)
LOG: Appbase = file:///C:/Users/D0259/Documents/Visual Studio 2013/Projects/OutlookAddIn3/OutlookAddIn3/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : OutlookAddIn3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208
LOG: Attempting download of new URL file:///C:/Users/D0259/Documents/Visual Studio 2013/Projects/OutlookAddIn3/OutlookAddIn3/bin/Debug/IBM.Data.DB2.DLL.
ERR: Failed to complete setup of assembly (hr = 0x80131045). Probing terminated.
Other windows form project using the same dll is working. Really need some advice on this. Anyone face this error before? Viewers' help is highly appreciated.

ASP.NET Register Assembly error

I am WAY out of my league here, so I apologize if I'm asking a duplicate question, but I don't know where to start on this one.
I recently migrated an SQL database from SERVER1, where it was collocated with IIS hosting the web interface to access the database, to SERVER2. The web interface is now accessing the database properly, and through some application features I can access the data properly, with no error. However, when I try to run a report, I get this error:
How do I fix this?
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 5: Namespace="AjaxControlToolkit"
Line 6: TagPrefix="ajaxToolkit" %>
Line 7: <%# Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Line 8: Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
Line 9:
Source File: /source/Report5.aspx Line: 7
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.4028
UPDATE
I turned on logging and got this more detailed error:
=== Pre-bind state information ===
LOG: User = AURORAFCS\raj
LOG: DisplayName = Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Family/
LOG: Initial PrivatePath = C:\Family\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Family\web.config
LOG: Using host configuration file: \\?\c:\windows\microsoft.net\framework\v2.0.50727\aspnet.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
UPDATE2
Using fusion logger, I have this more detailed message, which shoes it a is a "File Cannot Be Found" error. However, I have installed the redistributables, so why can it not find the DLL?
*** Assembly Binder Log Entry (11/21/2014 # 4:00:35 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = AURORAFCS\raj
LOG: DisplayName = Microsoft.ReportViewer.WebForms, Version=8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Partial)
LOG: Appbase = file:///C:/Family/
LOG: Initial PrivatePath = C:\Family\bin
LOG: Dynamic Base = c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\dc46260e
LOG: Cache Base = c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\dc46260e
LOG: AppName = 807e5b0d
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Family\web.config
LOG: Using host configuration file: \\?\c:\windows\microsoft.net\framework\v2.0.50727\aspnet.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
LOG: All probing URLs attempted and failed.
You need to determine what version of the ReportViewer Control you are targeting and install the proper package on the same server that your web app is deployed.
Microsoft Report Viewer 2010 Redistributable Package
Microsoft Report Viewer 2008 SP1 Redistributable
Microsoft Report Viewer Redistributable 2008
Microsoft Report Viewer Redistributable 2005
I am sure the logic is as follows:
ReportViewer 2010 can be used against SQL Server 2008(SP2) and 2012
ReportViewer 2008 can be used against SQL Server 2008 and 2005
ReportViewer 2005 can be used against SQL Server 2005
I found the answer to my problem in this blog:
http://www.orcsweb.com/blog/desiree/access-report-viewer-dll-files-for-your-application/
I just extracted the needed DLL and put it into one of the directories that the webapp was looking for. Still not sure why it happened, though.

Strange Castle AddFacility runtime error

I'am new to Castle and Castle.Windsor, so this is maybe a noob question.
I created an empty console .NET 4.0 application and added next packages through NuGet:
Castle Windsor factory support facility 3.0 beta 1 (3.0.2001)
Castle Windsor 3.0 beta 1 (3.0.2001)
Castle Core 3.0 beta 1 (3.0.2001)
Castle NHibernate facility (0.5.1.4000)
Fluent NHibernate (1.3.0.717)
NHibernate (3.2.0.4000)
Iesi Collections (3.2.0.4000)
and wrote next code:
static void Main(string[] args)
{
IWindsorContainer container = new WindsorContainer();
container.AddFacility<AutoTxFacility>();
//container.AddFacility<NHibernateFacility>();
}
But I got an error:
GenericArguments[0], 'TService', on 'Castle.MicroKernel.Registration.RegistrationGroup`1[S]' violates the constraint of type parameter 'S'.
If rewrite code and uncomment second AddFacility line:
static void Main(string[] args)
{
IWindsorContainer container = new WindsorContainer();
//container.AddFacility<AutoTxFacility>();
container.AddFacility<NHibernateFacility>();
}
I got next error:
Could not load type 'Castle.Facilities.FactorySupport.FactorySupportFacility' from assembly 'Castle.Windsor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc'.
I tried add container.AddFacility<Castle.Facilities.FactorySupport.FactorySupportFacility>(); line before first AddFacility but it not solve a problem.
In real application I got another error for same try and same libraries:
Could not load file or assembly 'Castle.Windsor, Version=2.5.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
with next FusionLog:
=== Pre-bind state information ===
LOG: DisplayName = Castle.Windsor, Version=2.5.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
(Fully-specified)
LOG: Appbase = file:///xxx.Test/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : Castle.Facilities.AutoTx, Version=3.0.202.2202, Culture=neutral, PublicKeyToken=407dd0808d44fbdc.
LOG: This bind starts in default load context.
LOG: Using application configuration file: xxx.Test\bin\Debug\xxx.Test.dll.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Castle.Windsor, Version=2.5.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
LOG: Attempting download of new URL file:///xxx.Test/bin/Debug/Castle.Windsor.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
I don't understand what I doing wrong.
This looks like the version of AutoTx facility you're using was compiled against older version of Windsor.
I'm not sure if the facility supports Windsor 3 yet, probably the best course of action is to ask at castle user googole group

Appbase being set to nothing at runtime

I have a difficult to reproduce error on about three user installs out of 20. This is a .net Windows application, 2005 in VB.Net running on XP. After opening up a window, we get an error:
Could not load file or assembly 'Infragistics2.Win.UltraWinChart.v8.2,
Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' or one of its
dependencies. Element not found. (Exception from HRESULT: 0x80070490) *****ClearTrac *****
at ClearTrac.ucNav.InitializeComponent()
at ClearTrac.ucNav..ctor()
at ClearTrac.frmPortfolio.InitializeComponent() ...
This happens also for the ReportViewer dll and a couple other infragistics dll's.
I turned on Bind Logging, and the first binds are ok, but when I get the error, the Appbase has been set to blank:
*** Assembly Binder Log Entry (2/20/2009 # 3:41:10 PM) ***
The operation failed.
Bind result: hr = 0x80070490. Element not found.
Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Documents and Settings\rdelaney\Local Settings\Apps\2.0\ZZ09GJK6.2VY\GPRTP6CM.GOX\clea..tion_8055aae51715540e_0001.0004_0a540274bbdc609c\ClearTrac.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = CAM\rdelaney
LOG: DisplayName = Microsoft.ReportViewer.WinForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase =
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = ClearTrac.exe`
Calling assembly : ClearTrac, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Documents and Settings\rdelaney\Local Settings\Apps\2.0\ZZ09GJK6.2VY\GPRTP6CM.GOX\clea..tion_8055aae51715540e_0001.0004_0a540274bbdc609c\ClearTrac.exe.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070490).
Any ideas?
You should check that on problematic computers the Microsoft.ReportViewer.WinForms is either in GAC or in application directory.
If it's not, you should install Microsoft Report Viewer redistributable on problematiuc computers.
http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e-bb5f-416d75a1b9ef&displaylang=en
We found this error only happens under the .net Framework with SP1 or SP2 installed. With the bare .net framework 2.0 installed, it does not happen.