mHelpMe
mHelpMe

Reputation: 6668

App works on my computer but not colleagues - Could not load file or assembly or one of its dependencies

I have a wpf application that runs on my computer fine.

The application opens on a colleagues computer but when he clicks one of the buttons an exception appears.

The exception is

Could not load file or assembly 'ABC, Version=1.0.0.0, Culture=netural, PublicKeyToken=null' or one of its dependencies

My application has two projects, ABCWPF & ABCLibrary. I had a console application which was called ABC.

I made a copy of this project and changed the output type to Class Library. I renamed all the folder names from ABC to ABCLibrary as well as the two files below,

 ABC.csproj renamed to ABCLibrary.csproj
 ABC.user renamed to ABCLibrary.user

I also updated one line in the solution file for ABCLibrary shown below. Please note I didn't change the GUID's I read that visual studio will automatically do that.

 Project("{Some GUID}") = "ABCLibrary", "ABCLibrary\ABCLibrary.csproj", "{Some GUID}"

In the properties page of ABCLibrary on the application section the Assembly name & Default namespace are both ABC.

Why will this run on my computer by not my colleagues?

Update

I've just used the fuslogvw. Looking at the log file for the assembly that is giving my colleague issues (ABC) and it says the bind result operation completed successfully, no issues that I can see

Another Update

So it works on my other colleagues computer so its appears to be this one computer (the one it really needs to run on). I did notice something (probably nothing but not getting anywhere) in windows explorer the app has an icon but on the computer that it isn't working on it has the visual studio default icon.

Update 3

So it works on some of my colleagues computer and other it doesn't. Is the error message telling me that there is a file in the assembly ABC that cannot be loaded? If so they only reference I have added is a Bloomberg reference which every users uses everyday so not sure what is going on

Upvotes: 1

Views: 525

Answers (2)

Paul Oliver
Paul Oliver

Reputation: 7671

There could be any number of problems why a computer can't load an assembly. Some reasons may include:

  • The .DLL file doesn't exist in the application folder structure
  • The .DLL file should be in the GAC, but isn't
  • The .DLL file could have a different name than expected
  • The .DLL file could have a different signature and so the CLR refuses to load it.
  • The .DLL could be compiled with a version of .NET incompatible to the calling library (i.e. .NET 3.5 calling a .NET 4.5.2 library).

I recommend you use the Assembly Binding Log Viewer (Fuslogvw.exe) to see the details of what's happening on the computer:

  1. Open the command prompt as an administrator
  2. Type fuslogvw in the command prompt
  3. Click on Settings
  4. Check the box that says "Log Bind Failure" or "Log all Binds"

To learn more about how to investigate a bind failure see Fuslogvw's page at MSDN

Upvotes: 1

Ram V
Ram V

Reputation: 734

Have you tried using FusionLog? FusionLog would give you all the paths that the Loader tried searching while loading the dependencies. Look at this link on how to turn on the fusion log.

Upvotes: 1

Related Questions