【转】VS调试出现LoaderLock异常的解决方法
原文地址:https://jingyan.baidu.com/article/bea41d439008dcb4c51be60b.html
异常信息为:正试图在 os 加载程序锁内执行托管代码。不要尝试在 DllMain 或映像初始化函数内运行托管代码,这样做会导致应用程序挂起。(Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.)

在下拉菜单中选择异常按钮;
在弹出的异常窗口中展开Managed Debugging Assistants,找到LoaderLock项;
去掉LoaderLock的选中状态,即取消LoaderLock项的勾选,确认;
再次调试系统将不再出现此类错误!

浙公网安备 33010602011771号