Solved

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

Posted on 2012-03-22
3
1,155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

729 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