In order to troubleshoot “Could not load file or assembly” and similar errors, you will need more details to find out the assembly that causes the issue. IIS doesn’t show the binding trace by default but you can enable it manually.
Example for an assembly 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.
Enable Fusion Logs so that you can see where the binding is failing. There are two ways to enable it:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
EnableLog
to 1
. If this key doesn’t exist, create it (DWORD(32-bit)
type)Other related registry keys:
DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
String LogPath set value to folder for logs (Example: C:\FusionLog\)
You can also use Microsoft’s Fusion Log Viewer utility (Reference) to enable Fusion Logs. Fusion Log Viewer is installed with Visual Studio. It should be in your “Microsoft SDKs” folder (Example path: C:\Program Files (x86)\Microsoft SDKs\Windows\v{SDK version}A\Bin\FUSLOGVW.exe)
You can also run it by using Visual Studio Command Prompt (Run the command prompt as Administrator):
Steps to enable assembly binding via Fusion Log Viewer:
After enabling it, reproduce the issue. Then click “Refresh” in the Fusion Log Viewer. You should see the binding failure listed. Click “View log” to see more information.
Disable assembly binding logging once you complete troubleshooting because it may affect your server’s performance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.