NativeProcess 无法在 Windows 上运行 C# WPF 应用程序

发布于 2024-12-27 03:47:03 字数 1296 浏览 3 评论 0原文

好的,

我们有一个运行 WPF 应用程序的 Adob​​e Air (AS3) 应用程序。但WPF应用程序无法通过这种方式运行。我在 EventViewer 中发现以下错误消息:

Faulting application name: Easysoft_MultiTouch_Document.exe, version: 1.0.0.0, time stamp: 0x4f0f2f9e
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0
Exception code: 0xe0434352
Fault offset: 0x000000000000aa7d
Faulting process id: 0xeac
Faulting application start time: 0x01ccd20c9e406d25
Faulting application path: E:\Apps\PDFProgram\Easysoft_MultiTouch_Document.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: dc656dc1-3dff-11e1-8870-00268330b66c

这是运行 WPF 应用程序的 Adob​​e Air 代码:

// following condition is true 
 if(NativeProcess.isSupported)
        {
        var file:File = new File("E:\\Apps\\GalleryProgram\\Easysoft_MultiTouch_Document.exe");
        trace(file.name);
        var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
        nativeProcessStartupInfo.executable = file;

        var process:NativeProcess = new NativeProcess();


        process.start(nativeProcessStartupInfo);
        //....
   }

我编写了另一个 C# 应用程序来运行此 WPF 可执行文件,但它也失败了。

如何解决这个问题? WPF应用程序可以这样运行吗?有什么解决办法吗?

提前致谢...

OK

We have a Adobe Air (AS3) application that runs our WPF application. but WPF application fails to run by this way. i found following error message in EventViewer:

Faulting application name: Easysoft_MultiTouch_Document.exe, version: 1.0.0.0, time stamp: 0x4f0f2f9e
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0
Exception code: 0xe0434352
Fault offset: 0x000000000000aa7d
Faulting process id: 0xeac
Faulting application start time: 0x01ccd20c9e406d25
Faulting application path: E:\Apps\PDFProgram\Easysoft_MultiTouch_Document.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: dc656dc1-3dff-11e1-8870-00268330b66c

and here is the Adobe Air code to run WPF application:

// following condition is true 
 if(NativeProcess.isSupported)
        {
        var file:File = new File("E:\\Apps\\GalleryProgram\\Easysoft_MultiTouch_Document.exe");
        trace(file.name);
        var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
        nativeProcessStartupInfo.executable = file;

        var process:NativeProcess = new NativeProcess();


        process.start(nativeProcessStartupInfo);
        //....
   }

I wrote another C# application to run this WPF executable file, but it fails too.

How fix this problem? Can WPF applications run by this way? any solution?

Thanks in advance...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魂归处 2025-01-03 03:47:03

您从进程中看到的特定异常代码是 0xe0434352。这表明抛出了托管异常。这意味着 WPF 进程很可能正在启动,至少达到加载 CLR 并运行托管代码的程度,然后引发未处理的托管异常。

这意味着故障很可能出现在 WPF 应用程序中。您是否已验证它可以在盒子上独立运行?如果是这样,那么我将设置调试器以在应用程序启动时附加,通过 Adob​​e Air 运行场景并查看此进程崩溃的原因。

The particular exception code you're seeing from the process is 0xe0434352. That's indicative of a managed exception being thrown. This means it's very likely that the WPF process is starting, at least getting to the point of loading the CLR and running managed code, and then throwing an unhandled managed exception.

This means the fault is most likely in the WPF application. Have you verified that it can run on it's own on the box? If so then I would setup the debugger to attach on start for the application, run the scenario through the Adobe Air and see why this process is crashing.

最终幸福 2025-01-03 03:47:03

我会尝试在 WPF 应用程序中引入一个阻塞点,并将异常记录到一个文本文件中,以便您获得有关错误的其他信息,如下所示:

        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

然后,在回调中,将任何异常详细信息写入文件

    static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        if (e.IsTerminating)
        {
            // Add your logging code here.
        }
    }

:这样您就可以获得有关崩溃原因的更多信息,并且您可以去那里。

I would try introducing a choke-point in the WPF application and log the exception to a text file, so that you have additional information about the error, something like this:

        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

Then, in the callback, write any exception details to a file:

    static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        if (e.IsTerminating)
        {
            // Add your logging code here.
        }
    }

This way you would have more information about the reason behind the crash and you could go grom there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文