none
after I use CLRHost to launch a C# App, the API SetUnhandledExceptionFilter cannot work RRS feed

  • 问题

  • I had make a c++ launcher to host clr because of the problem of "CoInitializeSecurity", I use ICLRRuntimeHost.ExecuteInDefaultAppDomain to start a managed method which calls App.Main to run the C# app.
    But there rise a new problem, before I use ICLRRuntimeHost to host C# app, SetUnhandledExceptionFilter will hook SEH exceptions, in which I would like to do some thing like writing a MiniDump, now the callback set by SetUnhandledExceptionFilter can't be call any more, instead c# will catch System.Runtime.InteropServices.SEHException by set Application.Current.DispatcherUnhandledException(WPF).

    The app interoperates to a native dll via p/invoke, so it's the best if can it record a MiniDump when crash happened in native dll. Can anyone help me? Thanks. 

    2013年9月5日 9:02

答案

  • http://social.msdn.microsoft.com/Forums/en-US/d8f5dd8d-f290-4f87-be2b-ba014d0a5510/after-i-use-clrhost-to-launch-a-c-app-the-api-setunhandledexceptionfilter-cannot-work
    yes, I've resolved it, thank you very much that guy
    • 已标记为答案 oldareyou 2013年9月12日 5:11
    2013年9月12日 5:11

全部回复

  • Hi,

    I suggest that you post your question with some code and detailed information in Visual C++ forum.

    And post the error message and stack trace from the WPF application in WPF forum for better responses.


    Caillen
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    2013年9月6日 8:32
    版主
  • thank you for your kind suggestion, but I think it's something about "CLR Host", so I asked here. It looks like CLR Host makes SEH exception can't be caught in native code.
    2013年9月9日 2:26
  • http://social.msdn.microsoft.com/Forums/en-US/d8f5dd8d-f290-4f87-be2b-ba014d0a5510/after-i-use-clrhost-to-launch-a-c-app-the-api-setunhandledexceptionfilter-cannot-work
    yes, I've resolved it, thank you very much that guy
    • 已标记为答案 oldareyou 2013年9月12日 5:11
    2013年9月12日 5:11