Visual Studio Professional 2012 svhost32.exe error running hello world

放肆的年华 提交于 2019-12-11 01:28:49

问题


I am new to Microsoft Visual Studio and have just installed Visual Studio 2012 on my computer. I am trying to run a simple hello world console application. This is my code:

using System;


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

when I run this either for debug or release it correctly displays the hello world in the console but then promptly gives me this error message: "vshost32.exe has stopped working" after researching the problem I figured out how to go into properties and unselect "Enable the visual Studio hosting process" which is what seemed to fix the problem for other people. But then when I try to run the code again all I get is "HelloWorld has stopped working". Does anyone have any ideas of what I could try next? Most solutions for this problem had to do with errors in peoples code but that seems a little hard to imagine since its hello world.

when I enable native code debugging this is the error message that I get:

First-chance exception at 0x77e3f9f2 in HelloWorld.exe: 0xC0000008: An invalid handle was specified.

This is the Call Stack

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()    

this is the new stack call after following the suggestions for getting symbols from microsoft.

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    

回答1:


I was looking at your stack trace and I took the first line that jumped out at me as something was wrong.

[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]

I searched Google and found the answer to the Question on [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]

I don't know if this will work or if you need to go through and try to load the Debugging symbols like this answer suggests

I tried to run this exact same code on my machine using VS2010 and had no issues.



来源:https://stackoverflow.com/questions/18855190/visual-studio-professional-2012-svhost32-exe-error-running-hello-world

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!