none
Fatal Execution Engine Error (7A097706) (80131506) RRS feed

  • Question

  • I'm attempting to wrap an old c++ dll in .NET code.  I'm using DllImport to define the functions I want to use and some of them work a little (in that they don't throw .NET errors, they run and throw their own internal error codes).  Some of them, however, shut the app down if they are called.  It generates the above error in the Event log.  The entire error message looks like this:

    Event Type: Error
    Event Source: .NET Runtime
    Event Category: None
    Event ID: 1023
    Date:  10/27/2008
    Time:  12:50:19 PM
    User:  N/A
    Computer: MyComputer
    Description:
    .NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A097706) (80131506)

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    I can identify the functions that cause this to happen, but I have no idea why this would happen.  Any thoughts?

    Monday, October 27, 2008 6:04 PM

Answers

  • Hmya, how did this get in this pickle?  How come you are using a DLL that you didn't buy a license to use?  If you're asking for help to break the copyright rulez, you'll find a cold shoulder here.  Contact the supplier of that DLL to work out a support and maintenance agreement.  If they are not around anymore, find the original programmer.  That's what you would prefer to happen when somebody uses your code.  Right?
    Hans Passant.
    Monday, October 27, 2008 11:40 PM
    Moderator

All replies

  • The generic diagnostic is that your C++ code is destroying data structures maintained by the CLR.  That's pretty easy to do, writing past the end of a buffer or through a stray pointer are common C/C++ mishaps.
    Hans Passant.
    • Proposed as answer by Petr Kadlec Wednesday, July 18, 2012 10:24 AM
    Monday, October 27, 2008 9:00 PM
    Moderator
  • If I don't have access to the c++ code (it isn't our dll), is there a way to combat this from the c# side or am I out of luck here?

    Monday, October 27, 2008 10:04 PM
  • Hmya, how did this get in this pickle?  How come you are using a DLL that you didn't buy a license to use?  If you're asking for help to break the copyright rulez, you'll find a cold shoulder here.  Contact the supplier of that DLL to work out a support and maintenance agreement.  If they are not around anymore, find the original programmer.  That's what you would prefer to happen when somebody uses your code.  Right?
    Hans Passant.
    Monday, October 27, 2008 11:40 PM
    Moderator
  • We have a license for it, but if there was a way around this problem without going back and asking them to fix their code I was willing to try it.  I don't have a lot of faith in their side.  They were supposed to provide us a code example to use their dll in C#.NET and they haven't gotten it to work yet.  Obviously, I haven't managed to get it to work either.
    Tuesday, October 28, 2008 3:13 PM
  • Aremd with your information from the other day, I went back to talk to the company who sent us the dll and wrote the original code.  I got a code xample out of them which consists of a C header and code file that I was instrcuted to compile on the command line into a dll.  Using that dll and a C# class file I was to then build an exe and run it to show that the code worked.  It did work.  However, it only works from the command line.  When I try to reference the same dll from a Visual Studio project by using DllImport it says it can't find the functions referenced.  The following are the commands I used on the command line to make it work (is it possible these are specifying something I need to manually specify within Visual Studio?):

    cl -Gz -I"c:\program files\folder\lib\include" -DMYLIBBASIC_EXPORT  mylibBasic.c  mylibBasic.def "C:\program files\folder\lib\win32\mylib.lib"  -LD -Fe"mylibBasic.dll"

    csc myClass.cs

     

    myClass.exe

    Thursday, October 30, 2008 7:28 PM