Solved

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

Posted on 2012-03-22
3
1,073 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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