admin管理员组文章数量:1334825
I have a C# app which uses a C# DLL which is a wrapper around PCL 1.12.1. The two known dependencies are vcredist and the 8 runtime. All the PCL dlls are deployed with the app.
I wanted to test it on a fresh machine. For this I picked a dell laptop and a VM. Both have x64 Win10 Pro and were installed using the same consumer Win10 ISO. Also both are fully up to date with identical versions (version 22H2, OSBuild 19045.5131). Both also have the known depdencies isntalled, I.e., the latest vcredist (14.42.34433) and 8 desktop runtime (8.0.11).
After copying my app to the documents folder of each user on each machine, on the laptop the app runs fine but on the VM the app crashes when attempting to call one of the DLL functions with the following error: Unhandled exception: System.DllNotFoundException: Unable to load DLL (myDll.dll) or one of its depdencies: A dynamic link library (DLL) initialization routine failed. (0x8007045A).
Things I've tried:
- using dumpbin to confirm the expected dependencies.
- using depencies; some missing dependencies are listed but these match on both the laptop and VM (all direct dependencies are fine but there are many dlls in the form ext-ms-win-xxx-l1-1-0.dll listed as missing inside some of the dependent DLLs)
- using depdency-walker: again many missing dependencies are listed but these match on the laptop and VM.
- using depdency-walkers profiling function but this locks up at roughly the point it calls out to the DLL on the VM (I tried leaving it for hours to see if it ever became responsive again to no avail) and weirdly profiling fails to run on the laptop where my app actually works with error code 0x0000142. In both instances I tried using dependency walker 2.2.6000 and 2.2.10011.
- using process monitor to monitor access to my DLL; with a filter to include events where path contains myDll.dll. My Dll is accessed a bunch by my app exe and MsMpEng.exe and a bit by csrss.exe on both the laptop and my VM. But also, on my VM it is hammered by WerFault.exe, I guess confirming my app has crashed. The PATH NOT FOUND entries are identical for each.
- using process monitor to monitor events made by my executable; there is no obvious difference here. There are lots of NAME NOT FOUND entries as it searches for dependencies but these roughly match on both the laptop and VM. Nothing stands out.
- adding logging to my DLLs in dllmain to log various events. Logging works fine on the laptop but no logging occurs on the VM, suggesting no code within the dll actually runs.
So how can I further diagnose this issue? Are there any other tools or strategies I can try? maybe there are some fundamental differences between VMs and physical installs I'm not considering?
本文标签: cHow can a dll initialisation failure be diagnosed (failing exclusively on VMs)Stack Overflow
版权声明:本文标题:c++ - How can a dll initialisation failure be diagnosed (failing exclusively on VMs)? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742345897a2457513.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论