【问题标题】:VS2015 Several projects throwing exceptions before mainVS2015 几个项目在main前抛出异常
【发布时间】:2015-11-16 17:58:43
【问题描述】:

我有几个项目是在 VS 2010 中创建的,但最近已更新到 VS 2015。所有项目都可以编译,但现在其中许多项目在到达 main 之前抛出异常:

'MyApp.exe' (Win32): Loaded 'C:\Users\kloux\Documents\Visual Studio 2010\Projects\BandwidthCruncher\Debug\MyApp.exe'. Symbols loaded.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sysfer.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-timezone-l1-1-0.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-file-l2-1-0.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-localization-l1-2-0.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-synch-l1-2-0.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-processthreads-l1-1-1.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-file-l1-2-0.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'MyApp.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
Exception thrown at 0x74F4C42D in MyApp.exe: Microsoft C++ exception: std::exception at memory location 0x0032F3EC.
Exception thrown at 0x74A17780 (sysfer.dll) in MyApp.exe: 0xC0000005: Access violation reading location 0x00000010.

我总是可以在结果对话框中选择“继续”,从那时起,应用程序似乎运行没有问题。这些是 GUI 应用程序和控制台应用程序的混合体。这似乎仅限于我从 VS 2010 导入的项目——我从来没有在 VS 2015 中创建的应用程序出现这种情况。

对于其中一个项目,我已经完成了删除所有外部库并将源代码缩减为仅包含以下内容的单个文件的过程:

#include <cstdlib>
int main(int, char**)
{
    return 0;
}

我什至取消选中“从父级或项目默认值继承”按钮。这些都没有任何影响 - 我仍然继续得到这个异常。

如果我使用 VS 2010 编译这些项目中的任何一个,问题就会消失——直到我再次使用 VS 2015 编译。在 VS 2015 中,更改平台工具集也无效。

感谢任何帮助。

谢谢!

编辑:当它应该读 VS 2010 时错误地写了 VS 2005

【问题讨论】:

    标签: visual-c++ visual-studio-2015


    【解决方案1】:

    Visual Studio 将在运行程序时加载 sysfer.dll(来自 Symantec CMC Firewall)。

    从您在此处复制的日志来看,sysfer.dll 似乎是这里的问题。

    这实际上是第一次机会例外。

    禁用加载sysfer.dll,使用regedit将以下注册表设置为4

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysPlant]
    "Start"=dword:00000004 
    

    修改注册表后重启。

    【讨论】:

    • 这听起来很有希望,但是我无法更改此注册表项(权限被拒绝)。我无法更改密钥的所有者,并且当使用 psexec 在系统级别运行 regedit 时,我无法进行更改或更改所有者。
    • 关闭防火墙服务;在这种情况下,计算机安全模式有帮助吗?我认为您应该能够在安全模式下更改注册表值。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-02
    • 1970-01-01
    • 2017-11-25
    • 1970-01-01
    • 2016-06-02
    • 2019-05-21
    相关资源
    最近更新 更多