Solved

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

Posted on 2012-03-22
3
1,046 Views
Last Modified: 2012-06-21
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
0
Comment
Question by:orgrau9
3 Comments
 
LVL 40
ID: 37755611
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.
0
 

Author Comment

by:orgrau9
ID: 37755724
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?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37765144
>Could not load file or assembly 'XXX, Version=3.0.2000.0, Culture=neutral, PublicKeyToken=798276055709c98a'

Does that version with that token exist in GAC?
Is the assembly COM visible?

Use process monitor to see what files its trying to access

http://technet.microsoft.com/en-us/sysinternals/bb896645
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question