0

I am working on a C++ DLL that is part of a much larger project, the application is written in C#.

Recently I am getting a Microsoft Visual Studio error displayed. I am debugging the project with Visual Studio, I've attached to the process. I have a break point in DllMain, but it crashes before it gets there, a dialog is displayed containing:

    First-change exception at 0x74372ea2 in ........Service.exe:
    Microsoft C++ exception EEFileLoadException at memory location 0x039bc4d4..

If I click on the Break button the Call stack is displayed:

[Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]
KernelBase.dll!74372ea2()
clr.dll!50bc454d()
clr.dll!50afc3ee()
clr.dll!50afc41d()
clr.dll!50afc440()
clr.dll!50b415a4()
clr.dll!50b1a8dc()
clr.dll!50b1a476()
clr.dll!50b1e0c4()
clr.dll!50b161b0()
clr.dll!50b238aa()
clr.dll!50b1f739()
clr.dll!50b1f739()
clr.dll!50b1c090()
clr.dll!50b22caf()
clrjit.dll!68971939()
clrjit.dll!689922a5()
clrjit.dll!68989fed()
clrjit.dll!689749d5()
clr.dll!50b1fecf()
clr.dll!50b1ffac()
clr.dll!50b1fff1()
clr.dll!50b2024f()
kernel32.dll!76933a61()
kernel32.dll!76933a61()
clr.dll!50adf405()
clr.dll!50adf35f()
clr.dll!50b209bf()
clr.dll!50b21780()
clr.dll!50adef11()
mscorlib.ni.dll!78fda29d()
mscorlib.ni.dll!790214a2()
mscorlib.ni.dll!790213d6()
mscorlib.ni.dll!79021391()
mscorlib.ni.dll!78fda1f8()
clr.dll!50adea56()
clr.dll!50af93ef()
clr.dll!50af9673()
clr.dll!50c3ecfd()
clr.dll!50afb213()
clr.dll!50afb27d()
clr.dll!50ae1c81()
clr.dll!50adf405()
clr.dll!50ae1c81()
clr.dll!50ae1e80()
clr.dll!50bd4917()
kernel32.dll!769395e4()
ntdll.dll!774d241a()
ntdll.dll!774d23e9()

What can I do to help me trace where the problem is?

[Edit] based on recommendation I did the following:

    Tools / Options / Debugging / Symbols

I specified the (.pdb) location which was the same as the DLL location:

    C:\Edwards\Scada\Agent Service\

I also checked the path to make sure that it was correct, sadly no difference.

[Edit 2] Bit more information, the C# part of this project is being developed in Visual Studio 2010. The C++ part is in Visual Studio 2008. I have no control over this.

SPlatten
  • 5,334
  • 11
  • 57
  • 128
  • 1
    [EEFileLoadException when using C# classes in C++](https://stackoverflow.com/questions/93770/eefileloadexception-when-using-c-sharp-classes-in-cwin32-app) – user7860670 Jul 23 '18 at 09:10
  • 3
    Make a stack trace like this readable by enabling the symbol server: Tools > Options > Debugging > Symbols. Debug managed exceptions by changing the debugger type: Project > Properties > Debugging > Debugger Type = Mixed. The 98% case here is the just-in-time compiler (clrjit.dll) not being able to find an assembly, FileNotFound is the 3rd boolean value. Ensure that the error handling in CLR hosting code is adequate to produce a decent diagnostic for such a basic mishap. – Hans Passant Jul 23 '18 at 09:34
  • @HansPassant, tried this, no change, I also checked the path I supplied to the dialog, and its correct with a PDB for each DLL. – SPlatten Jul 23 '18 at 09:39
  • Well, of course there is a change when you enable the symbol server. Every shortcut you take costs you an extra day to solve this problem. Google "what is a first-chance exception" to find out what to do next. – Hans Passant Jul 23 '18 at 10:27
  • @HansPassant, thank you, I'm no further forward tho. – SPlatten Jul 23 '18 at 10:32

0 Answers0