473,379 Members | 1,255 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

FileLoadException

Goal:
Use an example project I found which illustrates use of design patterns that
facilitate unit testing, so I can incorporate these patterns into my own
projects. One pattern is built on NHibernate. The dll for nhibernate which
came with the project was version v1.1.4322, as the sample code is almost a
year old. The NHibernate dll I downloaded is v2.0.50727.

Problem(s):
* I could not get this one project of several to complile, so I started to
migrate the entire solution to a new solution using updated versions of the
dependent dlls, like NHibernate.This worked well for several dependent
projects I needed to compile and test prior to this one.
* After migrating this sub-project to my new solution builds fine, but when
I run a test that uses NHibernate, I get:
"Could not load file or assembly 'NHibernate, Version=1.2.0.4000,
Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its
dependencies. The located assembly's manifest definition does not match the
assembly reference."

How can I fix this??

Why is my test looking for v1.2 in the first place. The reference dll it's
built on s/n 2.0. I looked in the GAC but didn't see any NHibernate
assemblies there.

Thanks for any help! BH
Sep 25 '08 #1
5 2191
Berryl Hesh <ef******@yahoo.comwrote:
Goal:
Use an example project I found which illustrates use of design patterns that
facilitate unit testing, so I can incorporate these patterns into my own
projects. One pattern is built on NHibernate. The dll for nhibernate which
came with the project was version v1.1.4322, as the sample code is almost a
year old. The NHibernate dll I downloaded is v2.0.50727.
Those sound very unlikely numbers - they are the version numbers of the
..NET framework itself. It's unlikely that NHibernate just happened to
use the same minor version numbers.
Problem(s):
* I could not get this one project of several to complile, so I started to
migrate the entire solution to a new solution using updated versions of the
dependent dlls, like NHibernate.This worked well for several dependent
projects I needed to compile and test prior to this one.
* After migrating this sub-project to my new solution builds fine, but when
I run a test that uses NHibernate, I get:
"Could not load file or assembly 'NHibernate, Version=1.2.0.4000,
Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its
dependencies. The located assembly's manifest definition does not match the
assembly reference."

How can I fix this??

Why is my test looking for v1.2 in the first place. The reference dll it's
built on s/n 2.0. I looked in the GAC but didn't see any NHibernate
assemblies there.
Not sure what you mean by "s/n" there.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Sep 25 '08 #2
You're right about the numbers being CLR versions. The version of NHibernate
refernce in the project is 2.0.0.4000. My question is where is the old
version 1.2.0.4000 in the error message is coming from?
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*********************@msnews.microsoft.com. ..
Berryl Hesh <ef******@yahoo.comwrote:
>Goal:
Use an example project I found which illustrates use of design patterns
that
facilitate unit testing, so I can incorporate these patterns into my own
projects. One pattern is built on NHibernate. The dll for nhibernate
which
came with the project was version v1.1.4322, as the sample code is almost
a
year old. The NHibernate dll I downloaded is v2.0.50727.

Those sound very unlikely numbers - they are the version numbers of the
.NET framework itself. It's unlikely that NHibernate just happened to
use the same minor version numbers.
>Problem(s):
* I could not get this one project of several to complile, so I started
to
migrate the entire solution to a new solution using updated versions of
the
dependent dlls, like NHibernate.This worked well for several dependent
projects I needed to compile and test prior to this one.
* After migrating this sub-project to my new solution builds fine, but
when
I run a test that uses NHibernate, I get:
"Could not load file or assembly 'NHibernate, Version=1.2.0.4000,
Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its
dependencies. The located assembly's manifest definition does not match
the
assembly reference."

How can I fix this??

Why is my test looking for v1.2 in the first place. The reference dll
it's
built on s/n 2.0. I looked in the GAC but didn't see any NHibernate
assemblies there.

Not sure what you mean by "s/n" there.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com

Sep 25 '08 #3
Berryl Hesh <ef******@yahoo.comwrote:
You're right about the numbers being CLR versions. The version of NHibernate
refernce in the project is 2.0.0.4000. My question is where is the old
version 1.2.0.4000 in the error message is coming from?
That does seem odd. What does the stack trace look like? That might
show what's expecting 1.2.0.4000. The fact that the "4000" is the same
in both cases is somewhat suspicious.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Sep 25 '08 #4
Berryl Hesh <ef******@yahoo.comwrote:
(Exception from HRESULT: 0x80131040)

I am thinking it's some configuration type of problem. I get the same error
if I exclude the config file that came with the code, and the code near the
start of the error is trying to load that file too.
Okay, I suggest you have a look at the Castle DLLs to see whether they
reference v1.2.0.4000. That looks like the most likely candidate.

The other thing that you can do is turn on the fusion log (search for
details) which I *think* explains why assemblies are loaded.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Sep 26 '08 #5
Using ildasm I can see in Castle.ActiveRecord's manifest the explanation for
the error:
.assembly extern NHibernate
{
.publickeytoken = (AA 95 F2 07 79 8D FD B4 ) // ....y...
.ver 1:2:0:4000
}

It seems like a pretty popular solution, so I'm surprised there isn't a
build incorporation NHibernate's newest release, or even some mention of it.
So now I have to decide whether to use the older NHibernate dll (this sounds
confusing if ever the newer one's features become desireable), or try to
make an ActiveRecord build myself with the new NHibernate (sounds like
trouble, and if it were easy I would find it somewhere

Thanks again for your help - BH

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*********************@msnews.microsoft.com. ..
Berryl Hesh <ef******@yahoo.comwrote:
>(Exception from HRESULT: 0x80131040)

I am thinking it's some configuration type of problem. I get the same
error
if I exclude the config file that came with the code, and the code near
the
start of the error is trying to load that file too.

Okay, I suggest you have a look at the Castle DLLs to see whether they
reference v1.2.0.4000. That looks like the most likely candidate.

The other thing that you can do is turn on the fusion log (search for
details) which I *think* explains why assemblies are loaded.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com

Sep 26 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Daniel Mori | last post by:
Im at a loss on where to proceed next. I wonder if anyone can help me. I have a managed C++ DLL is basically a thin wrapper around several unmanaged classes. This DLL builds fine. In my...
1
by: ptass | last post by:
Does anyone know what causes and how to prevent getting System.IO.FileLoadException everytime you launch a new version of an .exe via a href. ? The full error reads...An exception...
4
by: ptass | last post by:
Does anyone know what causes and how to prevent getting System.IO.FileLoadException everytime you launch a new version of an .exe via a href. ? The error reads...An exception...
6
by: Ken Varn | last post by:
I am trying to remote debug a C# application but the debugger is reporting the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module....
1
by: Fabian Aichele | last post by:
Hello! When trying to use Novell's C# LDAP library (from http://www.novell.com/coolsolutions/cooldev/features/a_net_cplus_ldap_library_cdev.html) the following exception occurs as soon as I try...
5
by: Elhanan | last post by:
hi.. i have a small csharp console application i'm running locally on a windows 2003 server, the files themselves are located on a novell server. when i try to run it and a call a method from...
0
by: Elhanan | last post by:
hi.. i'm using windows 2003 server as a develop machine with VS.NET 2003 all my source code and dll are on a network share on novell server. when i try to run a project which use microsoft...
2
by: Bern McCarty | last post by:
I am getting the following error when one of my mixed-mode assemblies trys to call a method in another. Both are strongly named, neither are in the GAC. Execution is in a non-default AppDomain in...
2
by: moose | last post by:
Hi, In C++/CLI (with VS2005 beta2) I wrote a little wrapper around a native dll (to which I headers and .lib). Wrapper was a ref class with some methods calling native functions from native dll....
0
by: Yueming | last post by:
Hello, I am using Visual Studio .NET 2003 (7.1) C++ on Windows XP. I created a project using Windows Service (.NET). I used all the default except my project name. After the project is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.