%3CLINGO-SUB%20id%3D%22lingo-sub-784396%22%20slang%3D%22en-US%22%3EFusion%20Log%20Viewer%20(fuslogvw.exe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-784396%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20order%20to%20troubleshoot%20%E2%80%9C%3CSTRONG%3ECould%20not%20load%20file%20or%20assembly%3C%2FSTRONG%3E%E2%80%9D%20and%20similar%20errors%2C%20you%20will%20need%20more%20details%20to%20find%20out%20the%20assembly%20that%20causes%20the%20issue.%20IIS%20doesn%E2%80%99t%20show%20the%20binding%20trace%20by%20default%20but%20you%20can%20enable%20it%20manually.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%20for%20an%20assembly%20binding%20issue%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3ECould%20not%20load%20file%20or%20assembly%20%E2%80%98Oracle.DataAccess%E2%80%99%20or%20one%20of%20its%20dependencies.%20An%20attempt%20was%20made%20to%20load%20a%20program%20with%20an%20incorrect%20format.%3C%2FEM%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20563px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F125316iB8A95123D09B68C3%2Fimage-dimensions%2F563x432%3Fv%3D1.0%22%20width%3D%22563%22%20height%3D%22432%22%20alt%3D%221.jpg%22%20title%3D%221.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1795237407%22%20id%3D%22toc-hId-1795237407%22%20id%3D%22toc-hId-1795237407%22%20id%3D%22toc-hId-1795237407%22%20id%3D%22toc-hId-1795237407%22%20id%3D%22toc-hId-1795237407%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--756919554%22%20id%3D%22toc-hId--756919554%22%20id%3D%22toc-hId--756919554%22%20id%3D%22toc-hId--756919554%22%20id%3D%22toc-hId--756919554%22%20id%3D%22toc-hId--756919554%22%3EEnable%20Fusion%20Logs%20(Assembly%20Binding%20Logging)%3C%2FH2%3E%0A%3CP%3EEnable%20Fusion%20Logs%20so%20that%20you%20can%20see%20where%20the%20binding%20is%20failing.%20There%20are%20two%20ways%20to%20enable%20it%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ERegistry%20Editor%3C%2FLI%3E%0A%3CLI%3EFusion%20Log%20Viewer%20(fuslogvw.exe)%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH4%20id%3D%22toc-hId-592863771%22%20id%3D%22toc-hId-592863771%22%20id%3D%22toc-hId-592863771%22%20id%3D%22toc-hId-592863771%22%20id%3D%22toc-hId-592863771%22%20id%3D%22toc-hId-592863771%22%3E%26nbsp%3B%3C%2FH4%3E%0A%3CH4%20id%3D%22toc-hId--1959293190%22%20id%3D%22toc-hId--1959293190%22%20id%3D%22toc-hId--1959293190%22%20id%3D%22toc-hId--1959293190%22%20id%3D%22toc-hId--1959293190%22%20id%3D%22toc-hId--1959293190%22%3ERegistry%20Editor%3A%3C%2FH4%3E%0A%3COL%3E%0A%3CLI%3EOpen%20Registry%20Editor%3C%2FLI%3E%0A%3CLI%3EGo%20to%3CCODE%3EHKEY_LOCAL_MACHINE%5CSOFTWARE%5CMicrosoft%5CFusion%3C%2FCODE%3E%3C%2FLI%3E%0A%3CLI%3EChange%20the%20value%20of%20%3CCODE%3EEnableLog%3C%2FCODE%3E%20to%20%3CCODE%3E1%3C%2FCODE%3E.%20If%20this%20key%20doesn%E2%80%99t%20exist%2C%20create%20it%20(%3CCODE%3EDWORD(32-bit)%3C%2FCODE%3E%20type)%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20545px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F125315i203B872B2EB0BD31%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222.png%22%20title%3D%222.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EOther%20related%20registry%20keys%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EDWORD%20ForceLog%20set%20value%20to%201%0ADWORD%20LogFailures%20set%20value%20to%201%0ADWORD%20LogResourceBinds%20set%20value%20to%201%0AString%20LogPath%20set%20value%20to%20folder%20for%20logs%20(Example%3A%20C%3A%5CFusionLog%5C)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--216482855%22%20id%3D%22toc-hId--216482855%22%20id%3D%22toc-hId--216482855%22%20id%3D%22toc-hId--216482855%22%20id%3D%22toc-hId--216482855%22%20id%3D%22toc-hId--216482855%22%3EFusion%20Log%20Viewer%20(fuslogvw.exe)%3C%2FH4%3E%0A%3CP%3EYou%20can%20also%20use%20Microsoft%E2%80%99s%20Fusion%20Log%20Viewer%20utility%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fframework%2Ftools%2Ffuslogvw-exe-assembly-binding-log-viewer%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EReference%3C%2FA%3E)%20to%20enable%20Fusion%20Logs.%20Fusion%20Log%20Viewer%20is%20installed%20with%20Visual%20Studio.%20It%20should%20be%20in%20your%20%E2%80%9CMicrosoft%20SDKs%E2%80%9D%20folder%20(Example%20path%3A%26nbsp%3BC%3A%5CProgram%20Files%20(x86)%5CMicrosoft%20SDKs%5CWindows%5Cv%7BSDK%20version%7DA%5CBin%5CFUSLOGVW.exe)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20also%20run%20it%20by%20using%20Visual%20Studio%20Command%20Prompt%20(Run%20the%20command%20prompt%20as%20Administrator)%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20796px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F125317i10A059B06231D874%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%223.png%22%20title%3D%223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3ESteps%20to%20enable%20assembly%20binding%20via%20Fusion%20Log%20Viewer%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EClick%26nbsp%3Bfuslogvw.exe%26nbsp%3Bor%20run%20it%20using%20Visual%20Studio%20Command%20Prompt%3C%2FLI%3E%0A%3CLI%3EClick%20%E2%80%9C%3CSTRONG%3ESettings%3C%2FSTRONG%3E%E2%80%9C%3C%2FLI%3E%0A%3CLI%3ESelect%20%E2%80%9C%3CSTRONG%3ELog%20bind%20failures%20to%20disk%3C%2FSTRONG%3E%E2%80%9C%3C%2FLI%3E%0A%3CLI%3ECheck%20%E2%80%9C%3CSTRONG%3EEnable%20custom%20log%20path%3C%2FSTRONG%3E%E2%80%9C%3C%2FLI%3E%0A%3CLI%3ECreate%20the%20directory%20you%20want%20the%20logs%20to%20be%20recorded%20in%20(Example%3A%26nbsp%3BC%3A%5CFusionLogs)%3C%2FLI%3E%0A%3CLI%3EEnter%20the%20path%20of%20this%20folder%20in%20%E2%80%9C%3CSTRONG%3ECustom%20log%20path%3C%2FSTRONG%3E%E2%80%9D%20field%3C%2FLI%3E%0A%3CLI%3EClick%20%E2%80%9C%3CSTRONG%3EOK%3C%2FSTRONG%3E%E2%80%9C%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EAfter%20enabling%20it%2C%20reproduce%20the%20issue.%20Then%20click%20%E2%80%9C%3CSTRONG%3ERefresh%3C%2FSTRONG%3E%E2%80%9D%20in%20the%20Fusion%20Log%20Viewer.%20You%20should%20see%20the%20binding%20failure%20listed.%20Click%20%E2%80%9C%3CSTRONG%3EView%20log%3C%2FSTRONG%3E%E2%80%9D%20to%20see%20more%20information.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDisable%20assembly%20binding%20logging%20once%20you%20complete%20troubleshooting%20because%20it%20may%20affect%20your%20server%E2%80%99s%20performance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-784396%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20order%20to%20troubleshoot%20%E2%80%9C%3CSTRONG%3ECould%20not%20load%20file%20or%20assembly%3C%2FSTRONG%3E%E2%80%9D%20and%20similar%20errors%2C%20you%20will%20need%20more%20details%20to%20find%20out%20the%20assembly%20that%20causes%20the%20issue.%20IIS%20doesn%E2%80%99t%20show%20the%20binding%20trace%20by%20default%20but%20you%20can%20enable%20it%20manually.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1719324%22%20slang%3D%22en-US%22%3ERe%3A%20Fusion%20Log%20Viewer%20(fuslogvw.exe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1719324%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20work%20for%20me.%20Thank%20you%20very%20much.%20%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Flaugh_40x40.gif%22%20alt%3D%22%3Alol%3A%22%20title%3D%22%3Alol%3A%22%20%2F%3E%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Flaugh_40x40.gif%22%20alt%3D%22%3Alol%3A%22%20title%3D%22%3Alol%3A%22%20%2F%3E%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Flaugh_40x40.gif%22%20alt%3D%22%3Alol%3A%22%20title%3D%22%3Alol%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1910992%22%20slang%3D%22en-US%22%3ERe%3A%20Fusion%20Log%20Viewer%20(fuslogvw.exe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1910992%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20you%20could%20add%20your%20post%20into%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fframework%2Ftools%2Ffuslogvw-exe-assembly-binding-log-viewer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fframework%2Ftools%2Ffuslogvw-exe-assembly-binding-log-viewer%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EIt%20would%20be%20perfect.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

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.

 

1.jpg

 

Enable Fusion Logs (Assembly Binding Logging)

Enable Fusion Logs so that you can see where the binding is failing. There are two ways to enable it:

  1. Registry Editor
  2. Fusion Log Viewer (fuslogvw.exe)

 

Registry Editor:

  1. Open Registry Editor
  2. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
  3. Change the value of EnableLog to 1. If this key doesn’t exist, create it (DWORD(32-bit) type)2.png
     

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\)

 

 

 

Fusion Log Viewer (fuslogvw.exe)

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):

 

3.png

 

Steps to enable assembly binding via Fusion Log Viewer:

  1. Click fuslogvw.exe or run it using Visual Studio Command Prompt
  2. Click “Settings
  3. Select “Log bind failures to disk
  4. Check “Enable custom log path
  5. Create the directory you want the logs to be recorded in (Example: C:\FusionLogs)
  6. Enter the path of this folder in “Custom log path” field
  7. Click “OK

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.

2 Comments
Occasional Visitor

It work for me. Thank you very much. :lol::lol::lol:

Microsoft