Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly '' or one of its dependencies. The process cannot access the file because it is being used by another process

I have just bought a new development machine and have taken the latest version of the source code of a project we are working on but when I try to debug it I get the following error:

Could not load file or assembly 'Business' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

"Business" is a class library project in the solution so it's unusual that it cannot load this assembly.

I've spent quite a big of time this morning double checking that the assembly references in both projects are targeting the same versions and they are.

like image 306
John Mc Avatar asked Sep 05 '15 11:09

John Mc


People also ask

Could not load file or assembly could not be found?

In summary if you get the "Could not load file or assembly error", this means that either your projects or their references were built with a reference to a specific version of an assembly which is missing from your bin directory or GAC.

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

“An attempt was made to load a program with an incorrect format.” That means that the assembly, which was to be loaded, was in an unexpected format. The format, in this case, refers most likely to the 64-bit build of an application being deployed to IIS, which is being run in 32-bits.

Is the process Cannot access the file because another process?

Process cannot access file because it is being used by another process error message. To resolve this error: Press Ctrl + Alt + Delete, then click Task Manager. Ensure you're on the Processes tab.

Could not load file or assembly Publickeytoken null or one of its dependencies?

This error usually means that the assembly was not found. Try verifying that the file exists in the directory where your application is running.


1 Answers

The new machine had Panda Anvirus Free version installed. Although no errors were reported by it, it was interfering with the debug session. Once it was disabled the application started to work.

Once Panda AV was uninstalled the problem was no more. Hope this helps someone else that encounters the same issue!

like image 138
John Mc Avatar answered Sep 29 '22 08:09

John Mc