前两天碰到了一个恶心的问题:本机安装的VS2013环境突然不能Build任何程序了,Build之后就会卡住,过一段时间之后显示Build Failed。VS2010环境能Build,但是跑起来会报莫名其妙的错误。
Event Log里能查到的内容为下面两条:
Application: MSBuild.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an internal error in the .NET Runtime at IP 61816AFA (61800000) with exit code 80131506.
以及
Faulting application name: MSBuild.exe, version: 12.0.40629.0, time stamp: 0x5590a5cf
Faulting module name: clr.dll, version: 4.7.2558.0, time stamp: 0x59d413ce
Exception code: 0xc0000005
Fault offset: 0x00016afa
Faulting process id: 0x6ff8
Faulting application start time: 0x01d3b0f96edd3a3d
Faulting application path: C:Program Files (x86)MSBuild12.0inMSBuild.exe
Faulting module path: C:WindowsMicrosoft.NETFrameworkv4.0.30319clr.dll
Report Id: ac9a0144-1cec-11e8-82c1-509a4c1fef2e
Faulting package full name:
Faulting package-relative application ID:
调查了很久没有结果,后来发现甚至基于.net framework的exe程序都打不开,Event Log里的错误如下:
Application: XXX.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an internal error in the .NET Runtime at IP 56656AFA (56640000) with exit code 80131506.
以及
Faulting application name: XXX.exe, version: 1.0.0.0, time stamp: 0x595a0549
Faulting module name: clr.dll, version: 4.7.2558.0, time stamp: 0x59d413ce
Exception code: 0xc0000005
Fault offset: 0x00016afa
Faulting process id: 0x83b0
Faulting application start time: 0x01d3b103cd3f886d
Faulting application path: X:XXXXXXXXX.exe
Faulting module path: C:WindowsMicrosoft.NETFrameworkv4.0.30319clr.dll
Report Id: 0b3083ac-1cf7-11e8-82c1-509a4c1fef2e
Faulting package full name:
Faulting package-relative application ID:
所以怀疑是.net framework的问题。根据路径想重装.net framework 4.0尝试,本机系统为Windows 8.1。但是发现了新问题:Windows 8.1下安装.net framework 4.5.1以下版本都会提示,本机已经包含了该版本,哪怕从控制面板把.net framework 4.5和4.5.1删掉也不能安装。
经过调查发现,.net framework 4.X向下兼容,也就是说安装4.6或者4.7能代替低版本(顺便一提,这种向下兼容只包含4.0以上,2.0和3.5不兼容),于是安装了.net framework 4.6。最终问题解决了。
引起问题的原因至今不明。。。希望能帮到不幸碰到类似问题的朋友们。