Compartilhar via


Assembly Binding Log Viewer (Fuslogvw.exe)

The Assembly Binding Log Viewer displays details for 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.

To view the contents of the Assembly Binding Log

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

  1. Select the Default option button to view bind failures for all application types. By default, log entries are stored in per-user directories on disk in the wininet cache.

  2. 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 custom log location in the Log Settings dialog 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

  1. Select the application name of the desired entry in the viewer.

  2. 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

  1. Select an entry in the viewer.

  2. 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 change the log settings

  • Click the Settings button to open the Log Settings dialog.

To view the About dialog

  • Click the About button.

The Log Settings Dialog

You can use the Log Settings dialog to perform the following actions.

To disable logging

  • Select the Log disabled option button. Note that this option is selected by default.

To log assembly binds in exceptions

  • Select the Log in exception text option button.

    See the Important note regarding assemblies that are loaded as domain neutral.

To log assembly bind failures

  • Select the Log bind failures to disk option button.

    See the Important note regarding assemblies that are loaded as domain neutral.

To log all assembly binds

  • Select the Log all binds to disk option button.

    See the Important note regarding assemblies that are loaded as domain neutral.

Important

When an assembly is loaded as domain neutral, for example by setting the LoaderOptimization property to System.LoaderOptimization.MultiDomain or System.LoaderOptimization.MultiDomainHost, turning on logging might leak memory in some cases. This can happen if a log entry is made when a domain-neutral module is loaded into an application domain, and later the application domain is unloaded. The log entry might not be released until the process ends. Some debuggers automatically turn on logging.

To enable a custom log path

  1. Select the Enable custom log path option button.

  2. Enter the path into the Custom log path text box.

Note

The Assembly Binding Log Viewer (Fuslogvw.exe) uses the Internet Explorer (IE) cache to store its binding log. Due to occasional corruption in the IE cache, the Assembly Binding Log Viewer (Fuslogvw.exe) can sometimes stop showing new binding logs in the viewing window. As a result of this corruption, the .NET binding infrastructure (fusion) cannot write to or read from the binding log. (This issue is not encountered if you use a custom log path.) To fix the corruption and allow fusion to show binding logs again, clear the IE cache by deleting temporary internet files from within the IE Internet Options dialog.

If your unmanaged application hosts the common language runtime by implementing the IHostAssemblyManager and IHostAssemblyStore interfaces, log entries can't be stored in the wininet cache. To view log entries for custom hosts that implement these interfaces, you must specify an alternate log path.

See Also

Reference

.NET Framework Tools
TypeLoadException Class
SDK Command Prompt

Concepts

Global Assembly Cache
How the Runtime Locates Assemblies