Tracking down System.IO.FileLoadException
Occasionally I have problems with applications which rely on unmanaged .dll's throwing exceptions which look like:
System.IO.FileLoadException: Could not load file or assembly 'AssemblyXXXX, Version=1.0.4099.27218, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1) File name: 'AssemblyXXXX, Version=1.0.4099.27218, Culture=neutral, PublicKeyToken=null' ---> System.Runtime.InteropServices.COMException (0x800736B1): This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
The main problem is, that it does not say which dll could not be loaded, or which COM object is not registered.
Are there any tools that help track down this problem开发者_JAVA百科?
Fuslogvw shows you details of assembly loading errors. However, I'm guess that it's a COM problem.
Try loading each of the COM dependencies dynamically (maybe in a different program, and maybe using their progid) using Type.GetTypeFromProgID
and Activator.CreateInstance
, and catching each error individually.
In the past, I've seen this error when there are different (older) versions of Office installed on user's machines.
精彩评论