Click here to Skip to main content
13,558,603 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 19 Apr 2012
Licenced CPOL

Diagnosing Assembly Bind Failures with Assembly Binding Log Viewer

, 19 Apr 2012
Rate this:
Please Sign up or sign in to vote.
The Assembly Binding Log Viewer provides the information on why an assembly can't be located by the .NET Framework.


We were defining custom tasks for MSBuild to call the XsltCompiler executable to generate an assembly - Chocolate.Cake.dll. But I kept getting a runtime error saying that "Could not load file or assembly 'Chocolate.Cake' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)".

Fig 1

I tried to clean build everything to ensure that an older version is not being picked up. No luck for me. I was wondering whether an older assembly was getting bound. I realized the best option to see why this binding was failing by using the Assembly Binding Log Viewer.

Assembly Binding Log Viewer

The Assembly Binding Log Viewer provides the information on why an assembly can't be located by the .NET Framework. It's installed with Visual Studio and with the Windows SDK.

To see the details, I had to run the utility with admin rights (Fig 2).

Fig 2

I clicked Settings, and selected the Log bind failures to disk radio option. After refreshing, as seen in snapshot 3, I could see an entry for my Chocolate.Cake assembly, confirming the failure.

Fig 3: Assembly Viewer

Fig 5: Log Contents

In my case, I viewed the log, and for the scenario described in the background, I noticed that an attempt was made to find the Chocolate.Cake.dll.DLL! Turns out that when using MSBuild for the custom task, in my build proj file, my input parameter of assembly name also incorrectly included an extension of DLL. I had to change this assembly name to Chocolate.Cake from Chocolate.Cake.dll and everything worked fine after this. 

You can obviously customize where the logs can be saved, etc. Additional details can be found here.


This has been a very brief introduction to a very useful utility which can help in diagnosing why an assembly bind failure is occurring.



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

My Tech World
United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

QuestionFormatting Pin
Mika Wendelius19-Apr-12 1:45
mvpMika Wendelius19-Apr-12 1:45 
QuestionNot an article Pin
Abhinav S18-Apr-12 19:42
mvpAbhinav S18-Apr-12 19:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180515.1 | Last Updated 19 Apr 2012
Article Copyright 2012 by My Tech World
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid