MyApp.vshost.exe: Managed (v4.0.30319)' has exited with code -1073741819 (0xc0000005). RRS feed

  • Question

  • Hello,

    I have a quite complex application which also uses inter process communication via named pipes and copying unmanaged memory around via InteropServices, etc. I.e. lots of potential sources for the access violation error 0xc0000005 I get when I exit the application in release mode. Now I just don't have a clue how and where to start my search. Can I do something similar to the memory leak detection in C/C++ (_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );)?

    I'm aborting a few threads at application end and in Debug I see according exceptions (an exception of type 'System.Threading.ThreadAbortException' occurred in LsfmInterop.dll but was not handled in user code). But that's about it.

    Thanks in advance for any suggestion

    Thursday, April 19, 2012 8:51 AM

All replies

  • Hi Neutronensturm,

    If you turn on "Break when an exception is Thrown" for CLR Exceptions (Ctrl+Alt+E in VS), execution should break while you are debugging and the exception is thrown. This will probably give you some insight into what is going on.

    Regards, http://shwetamannjain.blogspot.com

    Thursday, April 19, 2012 10:11 AM
  • Hi Neutronensturm,

    There is one more helpful post on forum, please check:


    Regards, http://shwetamannjain.blogspot.com

    Thursday, April 19, 2012 10:14 AM
  • Hi Shweta,

    I don't think it has sth. to do with a corrupt installation as it occurs on several different machines. Even if I compile on a different machine it remains the same.



    Thursday, April 19, 2012 10:58 AM
  • this one says, the problem could be with device drivers.


    Please mark this post as answer if it solved your problem. Happy Programming!

    Thursday, April 19, 2012 12:06 PM
  • This issue doesn't sound to be a memory leak, but we cannot figure out the root cause of an Access Violation without deeper investigation on the issue, usually, we will start from capturing and analyzing memory dumps, you can use DebugDiag tool to capture crash dump (http://blogs.msdn.com/b/kaevans/archive/2011/09/06/capturing-a-memory-dump-using-debugdiag-1-2.aspx), however, dump analysis is out of support range of this forum, please visit the below link to see the various paid support options that are available to better meet your needs.


    By the way, it seems that your application is running under Hosting Process (vshost.exe), to capture memory dump using DebugDiag tool, you may want to run the application standalone by double-click the executable file.


    [1] Hosting Process


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Eric Yang
    Microsoft Online Community Support

    Tuesday, April 24, 2012 8:15 AM
  • Just had this issue.

    I solved it by closing VS and manually removing all output files.

    Reopened VS, did a Rebuild All, run and all went normal.

    Thursday, April 11, 2013 11:30 PM