Assembly Binding Log Viewer (Fuslogvw.exe)
The Assembly Binding Log Viewer displays details for failed assembly binds. This information helps you diagnose why the .NET Framework cannot locate an assembly at run time. These failures are usually the result of an assembly deployed to the wrong location or a mismatch in version numbers or cultures. The common language runtime's failure to locate an assembly typically shows up as a TypeLoadException in your application.
Using the Assembly Binding Log Viewer
You can do the following with the Assembly Binding Log Viewer:
- View the contents of the Assembly Binding Log.
- Change the log location view.
- View details about a specific failure.
- Delete a single entry from the log.
- Delete all entries from the log.
- Refresh the user interface.
- Exit the viewer.
You can set registry keys to display additional information in the viewer:
- Display all binds in the log.
- Display bind failures to satellite assemblies in the log.
To view the contents of the Assembly Binding Log
- Run Fuslogvw.exe from the command line.
The following screen shot shows the Assembly Binding Log Viewer.
Assembly Binding Log contents
The viewer displays an entry for each failed assembly bind. For each failure, the viewer describes the application that initiated the bind; the assembly the bind is for, including name, version, culture and public key; and the date and time of the failure.
To change the log location view
Select the Default option button to view bind failures for all application types except ASP.NET. By default, log entries are stored in per-user directories on disk in the wininet cache.
Select the ASP.NET option button to view bind failures for ASP.NET applications. Storing log entries based on the user does not work well for ASP.NET because often all users run under the same user id in Web server scenarios. As a result, ASP.NET logs its bind failures in a per application cache directory.
Select the Custom option button to view bind failures in a custom directory that you specify. You must specify the custom location where you want the runtime to store the logs by setting the registry key HKLM\Software\Microsoft\Fusion\LogPath to a valid directory name. This directory should be clean, and only contain files that the runtime generates. If it contains an executable that generates a failure to be logged, the failure will not be logged because the tool tries to create a directory with the same name as the executable. In addition, an attempt to run an executable from the log location will fail.
Note The default bind location is preferable to the custom bind location. The runtime stores the default bind location in the wininet cache, and therefore automatically cleans it out. If you specify a custom bind location, you are responsible for cleaning it out.
To view details about a specific failure
Select the application name of the desired entry in the viewer.
Click the View Log button. Alternately, you can double-click the selected entry.
The tool displays the following details about the selected bind failure:
- The specific reason the bind failed, such as "file not found" or "version mismatch".
- Information about the application that initiated the bind, including its name, the application's root directory (AppBase), and a description of the private search path, if there is one.
- The identity of the assembly the tool is looking for.
- A description of any Application, Publisher, or Administrator version policies that have been applied.
- Whether the assembly was found in the global assembly cache.
- A list of all probing URLs.
The following sample log entry shows detailed information about a failed assembly bind.
** Assembly Binder Log Entry (3/5/2002 @ 12:54:20 PM) **
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\WINNT\Microsoft.NET\Framework\v1.0.3705\fusion.dll
Running under executable C:\Program Files\Microsoft.NET\FrameworkSDK\Samples\Tutorials\resourcesandlocalization\graphic\cs\graphicfailtest.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = graphicfailtest.resources, Version=0.0.0.0, Culture=en-US, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = C:\Program Files\Microsoft.NET\FrameworkSDK\Samples\Tutorials\resourcesandlocalization\graphic\cs\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : graphicfailtest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: graphicfailtest.resources, Version=0.0.0.0, Culture=en-US, PublicKeyToken=null
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft.NET/FrameworkSDK/Samples/Tutorials/resourcesandlocalization/graphic/cs/en-US/graphicfailtest.resources.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft.NET/FrameworkSDK/Samples/Tutorials/resourcesandlocalization/graphic/cs/en-US/graphicfailtest.resources/graphicfailtest.resources.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft.NET/FrameworkSDK/Samples/Tutorials/resourcesandlocalization/graphic/cs/en-US/graphicfailtest.resources.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft.NET/FrameworkSDK/Samples/Tutorials/resourcesandlocalization/graphic/cs/en-US/graphicfailtest.resources/graphicfailtest.resources.EXE.
LOG: All probing URLs attempted and failed.
To delete a single entry from the log
- Select an entry in the viewer.
- Click the Delete Entry button.
To delete all entries from the log
- Click the Delete All button.
To refresh the user interface
- Click the Refresh button. The viewer does not automatically detect new log entries while it is running. You must use the Refresh button to display them.
To exit the viewer
- Click the Exit button.
Other Configuration Settings
To log all binds in the viewer
- Set the HKLM\Software\Microsoft\Fusion\ForceLog registry value to 1 (the value is a DWORD).
By default, Fuslogvw.exe only logs failed attempts to locate assemblies. You might have a situation where it is useful to view all successful assembly binds. For example, you might want to verify that an assembly is loading from your application directory instead of from the global assembly cache. Setting this registry key forces Fuslogvw.exe to log all assembly binds.
To log bind failures to satellite assemblies
- Set the HKLM\Software\Microsoft\Fusion\LogResourceBinds registry value to 1 (the value is a DWORD).
By default, Fuslogvw.exe does not log failed attempts to locate satellite assemblies. Setting this registry key enables this feature.
See Also
.NET Framework Tools | Global Assembly Cache | How the Runtime Locates Assemblies | TypeLoadException Class