Link to home
Start Free TrialLog in
Avatar of orgrau9
orgrau9Flag for Afghanistan

asked on

"Could not load file or assembly" error VB.NET

Hi X-perts,

I have a VB.NET project that cannot be built on one particular PC with one particular DLL. The details:

1) I migrated a project to a new Win 7 64 PC (VS 2008).
2) When trying to build, it generates an error:

Cannot register assembly "XXX.dll". Could not load file or assembly 'XXX, Version=3.0.2000.0, Culture=neutral, PublicKeyToken=798276055709c98a' or one of its dependencies. One or more arguments are invalid (Exception from HRESULT: 0x80000003)      

3) I have another version of that DLL XXX.dll, which works fine on that "Bad PC".
4) Both versions of XXX.dll work fine on any other PCs (about 50 tested) except that "Bad PC"
5) Only one version of XXX.dll works on a "Bad PC"
6) .NET configurations are identical on ALL machines.
7) VS references on a "Bad PC" point to the same libraries with the same versions
8) I tried to decompile that XXX.dll with Reflector and it shows references to the same dependent libraries - for both versions:

mscorlib
System
System.Configuration
System.Drawing
System.Web
System.Web.Services
System.Windows.Forms
System.XML

All the dependencies' versions are the same for both XXX.dll libraries.

My question: what could prevent running one of the versions of that XXX.dll on a "Bad PC"? That XXX.dll is for .NET 2.0, quite old one.

Thanks
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Some 32-bits dlls do not work well with 64-bits applications. That might be causing your problem.

In the project's properties, in the Compile tab, under the Advanced Compile Options button, try setting the target CPU to x86 so that your application will compile in 32-bits.
Avatar of orgrau9

ASKER

32-bit is not a problem. First, i tried changing Compile Options to x86 - no difference.

Second, my other win 7 PC is also 64 bit, but both DLLs run perfectly.

My first guess was that the "Bad DLL" had difference dependencies versions on the "Bad PC". I checked all the versions - exactly the same on both PCs.

More ideas?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial