【问题标题】:Visual Studio 2019 'DLL Initialization Failed' - I can't run the appVisual Studio 2019 'DLL 初始化失败' - 我无法运行应用程序
【发布时间】:2021-12-14 18:37:30
【问题描述】:

直到昨天我都很好地使用了 VS2019。 今天,当我使用 F5 或 Ctrl-F5 运行我的 c++ 程序时,我收到了错误消息框。 我有下一条调试消息。

'cpp.exe' (Win32): Loaded 'C:\Users\user\source\repos\learn\x64\Debug\cpp.exe'. Symbols loaded.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. 
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. 
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. 
'cpp.exe' (Win32): Unloaded 'C:\Windows\System32\KernelBase.dll'
'cpp.exe' (Win32): Unloaded 'C:\Windows\System32\kernel32.dll'
The thread 0x2a54 has exited with code 3221225794 (0xc0000142).
The program '[13484] cpp.exe' has exited with code 3221225794 (0xc0000142) 'DLL Initialization Failed'.

有时,它适用于下一个调试消息。

'cpp.exe' (Win32): Loaded
   'C:\Users\user\source\repos\learn\x64\Debug\cpp.exe'. Symbols loaded.
       'cpp.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. 
       'cpp.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. 
       'cpp.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. 
       'cpp.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'. 
       'cpp.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1d.dll'. 
       'cpp.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. 
       'cpp.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. 
       The thread 0x2e88 has exited with code 0 (0x0).
       'cpp.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. 
       'cpp.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. 
       The thread 0x477c has exited with code 0 (0x0).
       The thread 0x335c has exited with code 0 (0x0).
       The program '[17728] cpp.exe' has exited with code 0 (0x0).

我认为加载 vcruntime*.dll 有问题 但我不知道该怎么办。

有线的东西有时会起作用。

任何建议将不胜感激。

【问题讨论】:

  • 也许用不同的选项重新安装整个 vs 可以解决这个问题。没有更多的问题了。谢谢。
  • 是的,我的第一个赌注也是 VS 安装损坏。如果现在能用就好了。

标签: visual-studio visual-c++ dll visual-studio-2019


【解决方案1】:

您的应用 (cpp.exe) 是 32 位还是 64 位?你在你的应用程序中使用 LoadLibrary 吗?您是否链接到特定的库? 尝试加载 32 位库的 64 位程序可能会出现问题,反之亦然。 如果您可以发送复制此问题的代码,解决您的问题会容易得多。

【讨论】:

    【解决方案2】:

    我遇到了和你一样的问题,还没找到原因。我的解决办法是,如果你能在任务管理器中找到名为 VsDebugConsole.exe 的进程,关闭它并再次调试。如果找不到,则完全关闭 Visual Studio 并重新打开它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-10
      • 2020-02-19
      • 2011-10-15
      • 1970-01-01
      • 2018-07-16
      • 1970-01-01
      • 2017-06-05
      • 2021-09-17
      相关资源
      最近更新 更多