Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracing all DLL loading and initializations in C++/CLI

I have a complex C++/CLI application with numerous modules (a few dozens), some managed some unmanaged. Recently we switched from Visual Studio 2013 to Visual Studio 2015. It's working on some computers but not on others.

When the program isn't working, it crashes even before the first line of main. It reports an Access Violation Exception in _onexit . When ignoring some of the exceptions and assertions I see that a <Module> threw a TypeInitializationException .

Problem is - I have no idea which one. I can see when DLLs are loaded in the Output window. The last DLL to load is System.dll - surely my bug is not there. So I need a way to trace static variable initialization in managed DLLs so I can figure out which DLL is problematic, then I can track down the problematic initialization.

How can I do that?

like image 852
zmbq Avatar asked May 24 '18 21:05

zmbq


1 Answers

Well, i feel a little stupid, but in a problem while loading with a type load exception I used fuslogvw.

I think it should give you the order of dll bindings and therefore a first impression.

like image 137
JackGrinningCat Avatar answered Oct 19 '22 04:10

JackGrinningCat