C# Source Code: Assembly Binding Log Viewer (Fuslogvw.exe)
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
C# Source Code
Assembly Binding Log Viewer (Fuslogvw.exe)
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Monday, October 16, 2006
Hits:
4652
Category:
General/Framework
Article:
To view the contents of the Assembly Binding Log Run Fuslogvw.exe from the command line. 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 ------------------------------- 1) 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. 2) 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. 3) 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 ---------------------------------------- 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: a) The specific reason the bind failed, such as "file not found" or "version mismatch". b) 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. c) The identity of the assembly the tool is looking for. d) A description of any Application, Publisher, or Administrator version policies that have been applied. e) Whether the assembly was found in the global assembly cache. f) 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. 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, the Assembly Binding Log Viewer (Fuslogvw.exe) does not log failed attempts to locate satellite assemblies. Setting this registry key enables this feature. 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.
Terms and Conditions
Support this site
Download a trial version of the best FTP application on the internet