Solved

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

Posted on 2012-03-22
3
966 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now