If you receive an “Assembly not found” error for your .NET application hosted in IIS, you may feel hopeless for not having much debugging details. IIS doesn’t show the binding trace as this slows down applications. However, there is a way to enable logging.
Example of an assembly/DLL binding issue:
Could not load file or assembly ‘Oracle.DataAccess’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
Use this quick trick to enable Assembly Binding Logging so that you can see where the binding is failing.
- Go to “Start > Run”
- Enter “regedit“
- Go to this key: “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion”
- Change the value of “EnableLog” to “1”. If this key doesn’t exist, create it with DWORD(32-bit) type
Note: Another way of viewing details for failed assembly bindings is to use Microsoft’s Fuslogvw tool. This tool is installed with Visual Studio. Refer to the link below for more details.