Radix
Radix

Reputation: 121

How to solve this issue `Could not load file or assembly 'xxxx' or one of its dependencies

I am new to Asp.net I have done one simple application in Asp.net with OpenCV cross library for image comparison.

Initially i set the project platform as x86 But when i tries to change that to x64 format it will show this error

Could not load file or assembly xxxx or one of its dependencies.
An attempt was made to load a program with an incorrect format  

How to solve this any suggestions?

Upvotes: 0

Views: 414

Answers (1)

Yusubov
Yusubov

Reputation: 5843

In short: It really depends on several facts and there might be two things that you may probably want to check in the first round of investigation:

1- Start by checking if you are referencing an assembly which in turn referencing an old version of unity. for example let's say you have an assembly called ServiceLocator.dll which needs an old version of Unity assembly, now when you reference the ServiceLocator you should provide it with the old version of Unity, and that makes the problem.

2- Look for the output folder where all projects build their assemblies, it might probably has an old version of unity.

In addition, you can use FuseLogVw application to find out who is loading the old assemblies, just define a path for the log, and run your solution, then check (in FuseLogvw) the first line where the Unity assembly is loaded, double click it and see the calling assembly, and here you go.

Upvotes: 1

Related Questions