简体   繁体   English

如何修复 .NET windows 应用程序在启动时崩溃并出现异常代码:0xE0434352?

[英]How do I fix a .NET windows application crashing at startup with Exception code: 0xE0434352?

I've built a .NET Windows Forms application in Visual Studio 2010. I also built a corresponding setup/install package via Visual Studio 2010. This is built as a 32-bit (x86) application. I've built a .NET Windows Forms application in Visual Studio 2010. I also built a corresponding setup/install package via Visual Studio 2010. This is built as a 32-bit (x86) application. (We make use of third-party Windows Forms controls that are 32-bit only). (我们使用仅 32 位的第三方 Windows Forms 控件)。

I am able to run the setup package and deploy successfully to other Windows 7 64-bit environments and 32 bit Windows XP boxes.我能够运行设置 package 并成功部署到其他 Windows 7 64 位环境和 32 位 Windows XP 机器。 The installed application runs fine on these.安装的应用程序在这些上运行良好。

However, when I attempt to run Windows Server 2008 R2 - 64 bit, the application crashes at startup.但是,当我尝试运行Windows Server 2008 R2 - 64 位时,应用程序在启动时崩溃。 It installed successfully via the installer without any errors.它通过安装程序成功安装,没有任何错误。

It appears to crash when loading the application.加载应用程序时似乎崩溃。 I put a message box as the first line in the application to see if it got past loading.我将一个消息框作为应用程序的第一行,以查看它是否通过加载。 The message box doesn't show up, so I assume that it occurs during loading/init of the application.消息框没有出现,所以我假设它发生在应用程序的加载/初始化期间。

So far I haven't found much to go on.到目前为止,我还没有找到太多关于 go 的内容。 From the Details I see the following:从详细信息中,我看到以下内容:

Exception Code: E0434352

I've fished around/googled to see if there was anything obvious, but I saw nothing.我到处钓鱼/谷歌搜索,看看是否有任何明显的东西,但我什么也没看到。 I saw some references to a possible stack overflow in the CLR .我在CLR中看到了一些对可能堆栈溢出的引用。

The Windows Forms application is built with the following references: Windows Forms 应用程序使用以下参考构建:

  • DevExpress开发快递
  • Infragistics Winforms controls Infragistics Winforms 控件
  • ORACLE DataAccess DLL ORACLE 数据访问 DLL
  • RabbitMQ RabbitMQ

What is the issue?问题是什么? How do I approach figuring this out?我该如何解决这个问题? How do I debug to get more useful information?如何调试以获得更多有用的信息?

If you are getting that error from Event Viewer, you should see another error event (at least one) from the Source ".NET Runtime".如果您从事件查看器中收到该错误,您应该会从源“.NET 运行时”中看到另一个错误事件(至少一个)。 Look at that error message as it will contain the Exception info.查看该错误消息,因为它将包含Exception信息。

0xE0434352 is the exception code for all .NET exceptions so that won't tell you much. 0xE0434352 是所有 .NET 异常的异常代码,所以不会告诉你太多。 How did you got this exception code?你是怎么得到这个异常代码的? The event log?事件日志?

Your best bet is to use a debugger to get more information.最好的办法是使用调试器来获取更多信息。 If the Visual Studio debugger won't help you, then you might need to check out WinDbg with SOS .如果 Visual Studio 调试器对您没有帮助,那么您可能需要使用SOS检查WinDbg See here and here for an introduction.有关介绍,请参见此处此处 Let it break on the exception, and see if you can get more information on the why.让它在异常上中断,看看你是否可以获得更多关于原因的信息。

If you suspect it is an issue when loading assemblies you might want to check out the Fusion Log .如果您在加载程序集时怀疑这是一个问题,您可能需要查看Fusion Log

I'm not sure if this will help anyone or not, but since it was my problem, I figure it's worth mentioning:我不确定这是否会帮助任何人,但由于这是我的问题,我认为值得一提:

I was getting this error, and it turned out to be a problem with the platform for which the EXE was built.我收到了这个错误,结果证明是构建 EXE 的平台有问题。 We had it building for x86, and it needed to be x64, because of an Oracle reference in the project.我们为 x86 构建了它,它需要是 x64,因为项目中有 Oracle 参考。 When we made that change, the problem went away.当我们做出改变时,问题就消失了。 So, see if you have any similar conflicts.所以,看看你是否有任何类似的冲突。

It looks like this error 0xe0434352 applies to a number of different errors.看起来这个错误 0xe0434352 适用于许多不同的错误。

In case it helps anyone, I ran into this error when I was trying to install my application on a new Windows 10 installation.如果它可以帮助任何人,当我尝试在新的 Windows 10 安装上安装我的应用程序时遇到了这个错误。 It worked on other machines, and looked like the app momentarily would start before dying.它可以在其他机器上运行,并且看起来该应用程序会在死前立即启动。 After much trial and error the problem turned out to be that the app required DirectX9.经过多次试验和错误,问题原来是该应用程序需要 DirectX9。 Though a later version of DirectX was present it had to have version 9. Hope that saves someone some frustration.尽管存在更高版本的 DirectX,但它必须具有版本 9。希望这可以为人们节省一些挫败感。

I was fighting with this a whole day asking my users to run debug versions of the software.我整天都在与这个问题作斗争,要求我的用户运行该软件的调试版本。 Because it looked like it didn't run the first line.因为它看起来好像没有运行第一行。 Just a crash without information.只是没有信息的崩溃。

Then I realized that the error was inside the form's InitializeComponent.然后我意识到错误出现在表单的 InitializeComponent 内部。

The way to get an exception was to remove this line (or comment it out):获得异常的方法是删除这一行(或将其注释掉):

System.Diagnostics.DebuggerStepThrough()

Once you get rid of the line, you'll get a normal exception.一旦你摆脱了这条线,你就会得到一个正常的异常。

Issue:问题:

.Net application code aborts before it starts its execution [Console application or Windows application] .Net 应用程序代码在开始执行之前中止 [控制台应用程序或 Windows 应用程序]

Error received: Aborted with Error code "E0434352"收到错误:中止,错误代码为“E0434352”

Exception : Unknown exception异常:未知异常

Scenario 1:场景一:

When an application is already executed, which have used some of the dependent resources and those resources are still in use with the application executed, when another application or the same exe is triggered from some other source then one of the app throws the error当一个应用程序已经执行时,它已经使用了一些依赖资源并且这些资源仍在与执行的应用程序一起使用,当另一个应用程序或相同的 exe 从某个其他来源触发时,其中一个应用程序会引发错误

Scenario 2:场景二:

When an application is triggered by scheduler or automatic jobs, it may be in execution state at background, meanwhile when you try to trigger the same application again, the error may be triggered.当应用程序被调度程序或自动作业触发时,它可能在后台执行state,同时当您再次尝试触发相同的应用程序时,可能会触发错误。

Solution:解决方案:

Create an application, when & where the application release all its resources as soon as completed Kill all the background process once the application is closed Check and avoid executing the application from multiple sources like Batch Process, Task Scheduler and external tools at same time.创建一个应用程序,一旦完成,应用程序在何时何地释放其所有资源 关闭应用程序后杀死所有后台进程 检查并避免同时从批处理、任务计划程序和外部工具等多个来源执行应用程序。 Check for the Application and resource dependencies and clean up the code if needed.检查应用程序和资源依赖关系,并在需要时清理代码。

I was getting this when the app deployed.部署应用程序时我得到了这个。 In my case, I chose "This is a full trust application" on the project security tab, and that fixed it.就我而言,我在项目安全选项卡上选择了“这是一个完全信任的应用程序”,并修复了它。

We got this error when the connection string to our database was incorrect.当我们数据库的连接字符串不正确时,我们收到此错误。 The key to figuring this out was running the dotnet blah.dll which provided a stacktrace showing us that the sql server instance specified could not be found.解决这个问题的关键是运行 dotnet blah.dll,它提供了一个堆栈跟踪,显示找不到指定的 sql 服务器实例。 Hope this helps someone.希望这可以帮助某人。

To fix the issue for me (as a number of applications started to throw this exception all of a sudden, for example, CorelDraw X6 being one), I uninstalled the .NET 4.5 runtime and installed the .NET 4 runtime.为了解决我的问题(因为许多应用程序突然开始抛出此异常,例如 CorelDraw X6 就是其中之一),我卸载了 .NET 4.5 运行时并安装了 .NET 4 运行时。 The two versions cannot be installed side by side, but they use the same version numbers in the GAC .这两个版本不能并排安装,但它们在GAC中使用相同的版本号。 This causes issues as some of the functions have been depreciated in 4.5.这会导致一些问题,因为某些功能已在 4.5 中折旧。

DLL Hell has returned... DLL 地狱又回来了……

So.. I had noticed in event viewer that this crash corresponded to a "System.IO.FileNotFoundException" error.所以.. 我在事件查看器中注意到此崩溃对应于“System.IO.FileNotFoundException”错误。

So I fired ProcMon and noticed that one of the program dlls was failing to load vcruntime140.所以我解雇了ProcMon并注意到其中一个程序 dll 无法加载 vcruntime140。 So I simply installed vs15 redist and it worked.所以我简单地安装了vs15 redist,它就可以工作了。

I know this is a somewhat old thread, but I had this problem too with ac#/WPF app I was creating.我知道这是一个有点旧的线程,但是我正在创建的 ac#/WPF 应用程序也遇到了这个问题。 The app worked fine on the development machine, but would not start on the test machine.该应用程序在开发机器上运行良好,但无法在测试机器上启动。 The Application Log in the Event Viewer gave a somewhat nebulous .NET Runtime error of System.IO.DirectoryNotFoundException.事件查看器中的应用程序日志给出了一个有点模糊的 .NET 运行时错误 System.IO.DirectoryNotFoundException。

I tried using some debugging software but the app would not stay running long enough to attach the debugger to the process.我尝试使用一些调试软件,但应用程序运行时间不够长,无法将调试器附加到进程。 After banging my head against my desk for a day and looking at many web pages like this one, what I wound up doing to troubleshoot this was to install VS2019 on my test machine.在将我的头撞在我的桌子上一天并查看了许多像这样的 web 页面之后,我最终解决这个问题的方法是在我的测试机器上安装 VS2019。 I then dragged the.exe file from its folder (it was deep in the Users[user]\AppData\Apps\2.0... folder) to the open VS2019 instance and went to start it from there.然后,我将 .exe 文件从其文件夹(位于 Users[user]\AppData\Apps\2.0... 文件夹的深处)拖到打开的 VS2019 实例并从那里启动它。 Immediately, it came up with a dialog box giving the exception and the cause.随即,它出现了一个对话框,给出了异常和原因。

In my case, when I added an icon to one of the forms, the complete path to the icon was placed into the XAML instead of just the icon name.就我而言,当我向 forms 之一添加图标时,图标的完整路径被放入 XAML 而不仅仅是图标名称。 I had copied the icon file into the project folder, but since the project folder does not exist on the test machine, this was the root cause of the error.我已经将图标文件复制到项目文件夹中,但由于测试机器上不存在项目文件夹,这是错误的根本原因。 I then removed the path from the XAML, leaving just the icon name one, rebuilt the solution and re-published it, and it ran just fine on the test machine now.然后我从 XAML 中删除了路径,只留下图标名称一个,重建解决方案并重新发布它,它现在在测试机器上运行良好。 Of course there are many causes besides what gave me the error, but this method of troubleshooting should hopefully identify the root cause of the error, since the Windows Event Viewer gives a somewhat vague answer.当然,除了给我错误的原因之外还有很多原因,但是这种故障排除方法应该有望确定错误的根本原因,因为 Windows 事件查看器给出了一个有点模糊的答案。

To summarize, use Visual Studio on the test machine as a debugger of sorts.总而言之,在测试机器上使用 Visual Studio 作为调试器。 But, to get it to work right, I had to drag the.exe file into the IDE and Start (run) it from there.但是,为了让它正常工作,我必须将 .exe 文件拖到 IDE 并从那里启动(运行)它。 I believe this will also work with VS2017 as well as VS2019.我相信这也适用于 VS2017 和 VS2019。 Hopefully this helps someone who is still having this issue.希望这可以帮助仍然遇到此问题的人。

When running a command line application it would immediately exit, and I saw this exception in the Event Viewer but received no other feedback.运行命令行应用程序时,它会立即退出,我在事件查看器中看到了这个异常,但没有收到其他反馈。 In my case, running the command prompt as administrator solved the problem .就我而言,以管理员身份运行命令提示符解决了这个问题

I believe one of the takeaways from this is simply that you may get this exception due to a permission issue.我相信从中得出的一个结论就是,由于权限问题,您可能会遇到此异常。

A few hours later we had the identical exception with a newer version of the console application for a different reason.几个小时后,由于不同的原因,我们在更新版本的控制台应用程序中遇到了相同的异常。 This time it turned out to be a dll version incompatibility.这次竟然是dll版本不兼容。 Using the required newer dll version solved the problem.使用所需的较新 dll 版本解决了该问题。

Perhaps this generic error comes up due to code that is not handling exceptions gracefully;也许这个一般错误是由于代码没有优雅地处理异常而出现的; with the best fix likely being to handle exceptions at least well enough to provide better error messages.最好的解决方法可能是处理异常至少足以提供更好的错误消息。

In my case, I was out of memory and my Windows System paging file was disabled.在我的情况下,我没有 memory 并且我的 Windows 系统页面文件被禁用。 After re-enabling it the error went away.重新启用后,错误消失了。

In order to change the paging file settings:为了更改页面文件设置:

  • Click Start, type Advanced System Settings into the Start menu and press Enter to open it.单击开始,在开始菜单中键入高级系统设置,然后按 Enter 键将其打开。
  • Click the Settings button under performance.单击性能下的设置按钮。
  • Click over to the Advanced tab and click the Change button in the Virtual memory section.单击高级选项卡,然后单击虚拟 memory 部分中的更改按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows应用程序启动错误异常代码:0xe0434352 - Windows Application Startup Error Exception code: 0xe0434352 我的 C# 应用程序将 0xE0434352 返回给 Windows 任务计划程序,但它没有崩溃 - My C# application is returning 0xE0434352 to Windows Task Scheduler but it is not crashing 无法启动Azure辅助角色,异常代码0xe0434352和0xC0000035 - Unable to start Azure Worker Role, exception code 0xe0434352 & 0xC0000035 异常代码 0xe0434352 崩溃 w3wp.exe | 点网运行 - Exception code 0xe0434352 that crashes w3wp.exe | dotnet run 应用程序在启动时崩溃,KERNELBASE.dll,异常代码e0434352 - App crashes at startup, KERNELBASE.dll, Exception Code e0434352 如何在Windows应用程序(.net)中启动 - How to work with startup in windows application(.net) 如何在.net WPF应用中添加应用到windows启动发送arguments? - How to add application to windows startup sending arguments in a .net WPF application? 我如何修复这个简单的Windows窗体应用程序 - how do i fix this simple windows forms application 如何在不使用任何代码的情况下在 Windows 启动时运行 WPF 应用程序 - How Can I Run the WPF application at Windows startup without using any code 如何在没有可见窗口的情况下启动.net Windows窗体应用程序? - How do I launch .net windows forms application with no visible windows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM