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.
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.
“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.
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.
This error usually means that the assembly was not found. Try verifying that the file exists in the directory where your application is running.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With