简体   繁体   English

从.NET 3.5迁移到.NET 4.0后,应用程序崩溃

[英]Application crash after moving from .NET 3.5 to .NET 4.0

Recently I upgraded .NET from 3.5 to 4.0 in my desktop application. 最近我在桌面应用程序中将.NET从3.5升级到4.0。 On my development machine it works fine. 在我的开发机器上它工作正常。

On some production machines it crashes right at start. 在某些生产机器上,它在开始时崩溃。

  1. Windows 8.1, Windows 7 Windows 8.1,Windows 7

    Problem Event Name: APPCRASH 问题事件名称:APPCRASH
    Application Name: myApp.exe 应用程序名称:myApp.exe
    Application Version: 2.0.0.0 应用版本:2.0.0.0
    Application Timestamp: 553a56e8 应用程序时间戳:553a56e8
    Fault Module Name: KERNELBASE.dll 故障模块名称:KERNELBASE.dll
    Fault Module Version: 6.3.9600.17415 故障模块版本:6.3.9600.17415
    Fault Module Timestamp: 54504ade 故障模块时间戳:54504ade
    Exception Code: e0434f4d 例外代码:e0434f4d
    Exception Offset: 00014598 例外抵消:00014598
    OS Version: 6.3.9600.2.0.0.256.4 操作系统版本:6.3.9600.2.0.0.256.4
    Locale ID: 1045 区域设置ID:1045

  2. Windows XP SP3 with .NET 4.0 带有.NET 4.0的Windows XP SP3

Faulting application myApp.exe, version 2.0.0.0, stamp 553a56e8, faulting module kernel32.dll, version 5.1.2600.6532, stamp 53203b53, debug? 错误应用程序myApp.exe,版本2.0.0.0,邮票553a56e8,错误模块kernel32.dll,版本5.1.2600.6532,邮票53203b53,调试? 0, fault address 0x00012fd3. 0,故障地址0x00012fd3。

在此输入图像描述

Please note that the source is .NET Runtime 2.0 Error . 请注意,源是.NET Runtime 2.0错误 Why? 为什么?

The application is compiled in .NET 4.0, which is installed on the machine. 该应用程序在.NET 4.0中编译,它安装在计算机上。

Another (much smaller and simpler) application from this solution, which is also compiled for .NET 4.0 works fine. 此解决方案的另一个(更小和更简单)应用程序,也为.NET 4.0编译工作正常。

Any ideas? 有任何想法吗?

You have to change the runtime .NET version in file App.config / web.config to: 您必须将文件App.config / web.config的运行时.NET版本更改为:

<startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM