Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Visual Studio Professional 2012 svhost32.exe运行hello world时出错_C#_Visual Studio 2012_Vshost.exe - Fatal编程技术网

C# Visual Studio Professional 2012 svhost32.exe运行hello world时出错

C# Visual Studio Professional 2012 svhost32.exe运行hello world时出错,c#,visual-studio-2012,vshost.exe,C#,Visual Studio 2012,Vshost.exe,我是Microsoft Visual Studio的新手,刚刚在我的计算机上安装了Visual Studio 2012。我正在尝试运行一个简单的hello world控制台应用程序。这是我的代码: using System; namespace HelloWorld { class Program { static void Main(string[] args) { Console.WriteLine("Hello,

我是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已停止工作”。有人知道我下一步可以尝试什么吗?这个问题的大多数解决方案都与人们代码中的错误有关,但这似乎有点难以想象,因为它是hello world

启用本机代码调试时,会收到以下错误消息:

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()    
这是在遵循从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    

我在看你的堆栈跟踪,我拿了第一行,因为有什么不对劲

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

我在谷歌上搜索,找到了这个问题的答案

我不知道这是否会起作用,或者您是否需要像下面所建议的那样通过并尝试加载调试符号


我尝试使用VS2010在我的计算机上运行完全相同的代码,但没有出现任何问题。

您是否以管理员身份运行Visual Studio?同样的情况也会发生,无论我是否以管理员身份运行,似乎都无关紧要。您尝试过从头开始吗?就像一个全新的控制台项目?是的,我试着从头开始,我试着重新启动程序,从头开始。没有什么。我可以创建一个运行良好的windows窗体应用程序。但不是安慰。而且它不像控制台项目没有运行,只是没有正确地终止或者其他什么。我没有尝试过的一件事是从命令行编译和运行。但理想情况下,我想让我的visual studio工作。是的,我知道,相信我,我一直在寻找。在这一点上,我已经准备好放弃,每次程序终止时,我都会因为程序崩溃而辞职。谢谢你的反馈,真的很感谢。我做了链接建议的所有事情,这稍微改变了我的堆栈跟踪,但没有太大影响。这个问题仍然存在。我将发布新的堆栈跟踪。谢谢你的帮助。另外,我对代码为您工作并不感到惊讶,我不明白的是hello world程序是如何崩溃的?为微软干杯?我完全同意你的看法,
helloworld
应用程序是如何崩溃的?不是对任何东西的评论,但是为了防止控制台在我看到结果之前关闭,我在
Console.ReadLine()
中加入了一个
Console.ReadLine(),这样直到我想要它关闭时它才会关闭。嗯。。。这实际上是对我问题的一种破解。在程序即将终止之前,代码实际上不会崩溃。。。因此,如果我添加
Console.ReadLine()
它在按下enter键之前不会崩溃:)这不是一个真正的解决方案,但它的反馈不那么令人沮丧。