.NET Tips and Tricks

Blog archive

Debug Load Errors with the Assembly Binding Log Viewer

One of the most frustrating error messages that you can get when debugging your application is "File not found" when loading an assembly (or just instantiating a new class). This message means that, for some reason, .NET couldn't find the DLL with the class you needed. If the reason for the problem isn't obvious from the information provided (and it usually isn't) there is a tool that will give you some more insight: the Assembly Binding Log Viewer (fuslogvw.exe).

As its name implies, the fuslogvw gives you access to a log file of binding activities. That logging is turned off by default so you must first enable it. The easiest way to do that is to run fuslogvw, click on the Settings button and select the level of logging you want before closing the viewer. You're probably only interested in those cases where loading an assembly is failing so, to have just those errors logged, select the "Log bind failures to disk" option.

You can then run your program and click on fuslogvw's refresh button to review the log entries. The viewer shows the information in three columns: Application, Description, and Date/Time. The description won't tell you much more than you got from running your application but if you double click on the log entry you'll get a ton more data to help you figure out what went wrong.

You'll see, for instance, all the paths that .NET looked through trying to find the assembly. You'll also see whether the loading process was affected by entries in your application's configuration file or whether all the parameters were set from the machine configuration file. The log viewer may not hand you the answer to your load failure but it will probably tell you something about what's going wrong that you didn't know before.

You may not be able to start fuslogvw from the Visual Studio command prompt -- the file moves around. On one of my computers, picked at random, I found it in C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin folder... but your mileage may vary. Wherever it is, however, the utility will wait patiently until you need it.

Posted by Peter Vogel on 07/05/2011 at 9:03 AM


comments powered by Disqus

Reader Comments:

Sat, Aug 6, 2011 Peter Vogel Canada

Nova: That's interesting--I don't get a log viewer entry in my menus. I wonder what you did right that I didn't do (apparently) at all?

Wed, Jul 27, 2011 ed243 NOVA

Fusion Log Viewer is under in the Start Menu->All Programs->Microsoft Visual Studio 2010->Microsoft Windows SDK Tools This version was located here: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64\FUSLOGVW.exe

Fri, Jul 15, 2011 Peter Vogel Canada

I know what you mean. When I listed the filepath in the article, I arbitrarily chose one path from three or four choices--and the VM I was using had a very plain Visual Studio 2010/.NET 4 load on it.

Mon, Jul 11, 2011 E. Anderson SEATTLE, WA

Having SDKs 6.0A, 7.0A, & 7.1 installed on my development machine, I found 10 copies of the executable with 8 of them unique. What's really interesting in the 7.x SDKs is a "plain" version and one for NETFX 4.0.

Add Your Comments Now:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.