2

我是 Microsoft Visual Studio 的新手,刚刚在我的计算机上安装了 Visual Studio 2012。我正在尝试运行一个简单的 hello world 控制台应用程序。这是我的代码:

using System;


namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
        }
    }
}

当我运行它进行调试或发布时,它会在控制台中正确显示 hello world 但随后立即给我此错误消息:“vshost32.exe 已停止工作” 在研究了问题后我想出了如何进入属性并取消选择“启用 Visual Studio 托管进程”,这似乎可以解决其他人的问题。但是当我再次尝试运行代码时,我得到的只是“HelloWorld 已停止工作”。有人对我接下来可以尝试什么有任何想法吗?这个问题的大多数解决方案都与人们代码中的错误有关,但这似乎有点难以想象,因为它是你好世界。

当我启用本机代码调试时,这是我得到的错误消息:

HelloWorld.exe 中 0x77e3f9f2 处的第一次机会异常:0xC0000008:指定了无效句柄。

这是调用堆栈

ntdll.dll!77e3f9f2()    
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] 
ntdll.dll!77e3f9f2()    
KernelBase.dll!76dbc455()   
kernel32.dll!76cb1408()     
AME_OutlookSensor.dll!74b8c60d()    
AME_OutlookSensor.dll!74b78ecb()    
AME_OutlookSensor.dll!74b78f9e()    
AME_OutlookSensor.dll!74b741d4()    
AME_OutlookSensor.dll!74b7432f()    
AME_OutlookSensor.dll!74b7439a()    
ntdll.dll!77e599a0()    
ntdll.dll!77e6d702()    
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
kernel32.dll!76cb1408()     
AME_OutlookSensor.dll!74b8c60d()    
AME_OutlookSensor.dll!74b78ecb()    
AME_OutlookSensor.dll!74b78f9e()    
AME_OutlookSensor.dll!74b741d4()    
AME_OutlookSensor.dll!74b7432f()    
AME_OutlookSensor.dll!74b7439a()    
ntdll.dll!77e599a0()    
ntdll.dll!77e6d702()    
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
AME_OutlookSensor.dll!74b8c60d()    
AME_OutlookSensor.dll!74b78ecb()    
AME_OutlookSensor.dll!74b78f9e()    
AME_OutlookSensor.dll!74b741d4()    
AME_OutlookSensor.dll!74b7432f()    
AME_OutlookSensor.dll!74b7439a()    
ntdll.dll!77e599a0()    
ntdll.dll!77e6d702()    
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
AME_OutlookSensor.dll!74b78ecb()    
AME_OutlookSensor.dll!74b78f9e()    
AME_OutlookSensor.dll!74b741d4()    
AME_OutlookSensor.dll!74b7432f()    
AME_OutlookSensor.dll!74b7439a()    
ntdll.dll!77e599a0()    
ntdll.dll!77e6d702()    
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
AME_OutlookSensor.dll!74b78f9e()    
AME_OutlookSensor.dll!74b741d4()    
AME_OutlookSensor.dll!74b7432f()    
AME_OutlookSensor.dll!74b7439a()    
ntdll.dll!77e599a0()    
ntdll.dll!77e6d702()    
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
 mscoreei.dll!706f3712()    
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
AME_OutlookSensor.dll!74b7432f()    
AME_OutlookSensor.dll!74b7439a()    
ntdll.dll!77e599a0()    
ntdll.dll!77e6d702()    
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
AME_OutlookSensor.dll!74b7439a()    
ntdll.dll!77e599a0()    
ntdll.dll!77e6d702()    
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
ntdll.dll!77e599a0()    
ntdll.dll!77e6d702()    
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
ntdll.dll!77e6d702()    
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
ntdll.dll!77e6d5a4()    
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
kernel32.dll!76cb79c5()     
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
mscoreei.dll!706f3712()     
mscoreei.dll!706e3126()     
mscoreei.dll!706e3216()     
mscoreei.dll!706e48ef()     
mscoreei.dll!706e4928()     
mscoreei.dll!706e47b0()     
mscoreei.dll!706e48a2()     
mscoreei.dll!706e48be()     
clr.dll!701f2e27()  
mscoreei.dll!706f38c4()     
clr.dll!701f2e27()  
clr.dll!701f2e27()  
clr.dll!701f2daa()  
clr.dll!701901df()  
clr.dll!70190226()  
clr.dll!7016c3d2()  
mscoreei.dll!706ef5a3()     
mscoree.dll!70767f16()  
mscoree.dll!70764de3()  
kernel32.dll!76cb336a()     
ntdll.dll!77e59f72()    
ntdll.dll!77e59f45()    

这是遵循从微软获取符号的建议后的新堆栈调用。

ntdll.dll!_ZwClose@4()  + 0x12 bytes    
ntdll.dll!_ZwClose@4()  + 0x12 bytes    
AME_OutlookSensor.dll!74b8c60d()    
[Frames below may be incorrect and/or missing, no symbols loaded for AME_OutlookSensor.dll] 
AME_OutlookSensor.dll!74b78ecb()    
AME_OutlookSensor.dll!74b78f9e()    
AME_OutlookSensor.dll!74b741d4()    
AME_OutlookSensor.dll!74b7432f()    
AME_OutlookSensor.dll!74b7439a()    
ntdll.dll!_LdrpCallInitRoutine@16()  + 0x14 bytes   
ntdll.dll!_LdrShutdownProcess@0()  + 0x141 bytes    
ntdll.dll!_RtlExitUserProcess@4()  + 0x74 bytes 
kernel32.dll!76cb79c5()     
mscoreei.dll!RuntimeDesc::ShutdownAllActiveRuntimes()  + 0x10e bytes    
mscoreei.dll!CLRRuntimeHostInternalImpl::ShutdownAllRuntimesThenExit()  + 0x13  bytes   
clr.dll!EEPolicy::ExitProcessViaShim()  + 0x65 bytes    
clr.dll!SafeExitProcess()  + 0x7d bytes 
clr.dll!DisableRuntime()  - 0xce069 bytes   
clr.dll!EEPolicy::HandleExitProcess()  + 0x42 bytes 
clr.dll!__CorExeMainInternal@0()  + 0xf2 bytes  
clr.dll!__CorExeMain@0()  + 0x1c bytes  
mscoreei.dll!__CorExeMain@0()  + 0x71 bytes 
mscoree.dll!_ShellShim__CorExeMain@0()  + 0x227 bytes   
mscoree.dll!__CorExeMain_Exported@0()  + 0x8 bytes  
ntdll.dll!___RtlUserThreadStart@8()  + 0x27 bytes   
ntdll.dll!__RtlUserThreadStart@8()  + 0x1b bytes    
4

1 回答 1

0

我正在查看您的堆栈跟踪,并且由于出现问题,我选择了第一行。

[下面的帧可能不正确和/或丢失,没有为 ntdll.dll 加载符号]

我搜索了谷歌并找到了关于[下面的框架可能不正确和/或丢失,没有为 ntdll.dll 加载符号]的问题的答案

我不知道这是否可行,或者您是否需要通过并尝试加载调试符号,如this answer建议

我尝试使用 VS2010 在我的机器上运行完全相同的代码并且没有任何问题。

于 2013-09-18T14:03:15.463 回答