![]() Run MainApp.exe after the capture begins.Add a Process Name filter for MainApp.exe to limit the displayed events to those related to MainApp only (This keeps the logs from becoming unmanageably large).Run Process Monitor and start capturing events.Run Process Monitor and monitor MainApp.exe Lets see how we can troubleshoot this problem using Process Monitor. NativeLib.dll is an unmanagedĭLL, so Fusion Log Viewer won’t detect it. ![]() However, in real world applications where each assembly can have dozens of dependencies scattered around the system, this can become a nightmare.Īs I mentioned above, Dependency Walker does not work with managed assemblies, so it won’t be helpful. Notice that the exception didn’t mention the actual missing dependency, it only pointed out that one of the NativeLibWrapper.dllĭependencies is missing, but which one? It’s easy to figure out the problem in this toy application due to it's small scope. Executing MainApp.exe now will result in the following error: To simulate a missing dependency, let's delete (You can download the complete solution from github here). MainApp references a managed wrapper library called NativeWrapper.dll, which references a native C++ dll called NativeLib.dll. To demonstrate how we can use Process Monitor for troubleshooting, I created a managedĪpplication called MainApp.exe. That shows you file system, registry, network, process and thread activity log. Process Monitor is an easy to use real-time event monitoring tool for Windows On “Could not load file or assembly” problems, as well as how this process can be automated. In this blog post I’ll discuss how we can use Process Monitor to do exploratory debugging That dynamically load native dlls or contain both native and managed assemblies. ![]() Both are great tools, and do their respective jobs well, but they fall short with applications ![]() Dependency Walker statically resolves all the DLLs neededīy a native PE file and flags missing dependencies, while Fusion Log ViewerĬatches assembly binding problems in managed code during runtime. There are numerous reasons why the loader can fail to load the requiredĭLLs, such as a missing dependency, calling code that does not have permission to read the needed DLL, etc.Īre common tools used to troubleshoot missing dependency problems. Could not load file or assembly exceptions occur when Windows is not able to load a dll needed by the calling code. The error above is possibly one of the most searched. Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'NativeLibWrapper.dll' or one of its dependencies. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |