gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 16:07:21 24 4
gpt4 key购买 nike

我是 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。

当我启用 native 代码调试时,这是我收到的错误消息:

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

这是调用栈

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

最佳答案

我正在查看您的堆栈跟踪,然后我发现了第一行,因为出了点问题。

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

我在 Google 上进行了搜索,并在 [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] 上找到了问题的答案。

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

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

关于c# - Visual Studio Professional 2012 svhost32.exe 运行 hello world 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18855190/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com