VS: Debugger not working

vs出现问题,不能调试:

A debugger dll, msdbg2.dll, is not correctly installed. Please repair your Visual Studio installation via 'Add or Remove Programs' in control panel.

但是debug版本的程序运行没问题,查找msdbg2.dll没有找到,(后来知道是找的目录不对);而且当时没有网(有网络真是事半功倍),按照竟然提示重装了……而且装得特别慢,结果还是不行。回来查了才知道注册一下所需的dll即可。非常方便。所找文章如下:


Debugger not working

转自http://blogs.msdn.com/yash/

Problem Description
================

When you try to debug a simple windows application in Visual Studio 2005, you get the following error :


----------------------------------
Microsoft Visual Studio
----------------------------------
Unable to start program '<application_name>'.A debugger dll, msdbg2.dll, is not correctly installed. Please repair your Visual Studio installation via 'Add or Remove Programs' in control panel.

If the problem persists, you can manually register msdbg2.dll from the command prompt with 'regsvr32 "%CommonProgramFiles%\Microsoft Shared\VS7Debug\msdbg.dll"'.
----------------------------------
OK  
----------------------------------

 

Diagnostic
=======

We can use Debugger Diagnostic Tool to find out any error about this :

This Tool is available here.

In order to simulate the problem, i tried to rename the msdbg2.dll file on my system and then run the DebuggerDiagnostic tool. The output that i get on my system is the following :


C:\Documents and Settings\prabhatt\My Documents\MSDN\Debugger Diagnostics>DebuggerDiagnostics.exe

Begin 'CheckMDMImage()'
mdm.exe: version '7.10.3077' with hash '{6607858A-7B579EC3-E062DAB3-BF891368-CBF1CB9C}'.
Result of 'CheckMDMImage()' is '00000000'

Begin 'CheckMSDBG2Image()'
Could not calculate hash for 'msdbg2.dll' - 0x80070002
Result of 'CheckMSDBG2Image()' is '80070002'

...

Begin 'CoCreateMachineDebugManager(&spMachine)'
Result of 'CoCreateMachineDebugManager(&spMachine)' is '8007007e'

 

Analysing the report
===============

We found that the following portion is reporting some error :

Begin 'CheckMSDBG2Image()'
Could not calculate hash for 'msdbg2.dll' - 0x80070002
Result of 'CheckMSDBG2Image()' is '80070002'

It states that it is unable to calculate the HASH value of the msdbg2.dll. Which indicates that there might be some problem with this DLL.

 

Root Cause
=======

There are three causes of this issue :-
1. The dll is not present physically at the specified path.
2. The dll is corrupted due to some unknown reason.
3. The dll is not the original one that comes with Visual Studio.

  

Conflict/Corrupt or missing msdbg2.dll
=======================

Once we identify that there are some issues with this dll, lets start identifying what might be the reason.

1. Manually search for the file in the directory C:\Program Files\Common Files\Microsoft Shared\VS7Debug

Is the file present there? If no we need to install the file there and register it properly.

There are several public sites from where we can download, install and register it. Since these sites might not be safe. I would recommend you to try installing the files from the installation disks of Visual Studio that you have.

2. If the file is physically present there, then it might be corrupted. So go ahead and install the new file from the installation disk and register it.

3. One interesting thing is that Office XP installation and Office XP update KB833858 also contain the same file msdbg2.dll. So if by any chance, if this file is installed by accident to the directory(C:\Program Files\Common Files\Microsoft Shared\VS7Debug) then also we may get this issue. We can verify this by checking the version, the file that comes with Visual Studio 2005 has the version 8.0.50727.42. On the other hand the file that comes with Office XP update (KB833858) has the version 7.0.9466.0. If this is the case unregister the dll. Install the original one and register it.

 

How to Unregister a dll
==============

1. Start->Run->cmd.
2. At a command prompt, type the following command:
regsvr32 /u <path_of_msdbg2.dll>\msdbg2.dll 

 

How to Register a dll
=============

1. Start->Run->cmd.
2. At a command prompt, type the following command:
regsvr32 <path_of_msdbg2.dll>\msdbg2.dll

转载于:https://www.cnblogs.com/liukainan/archive/2010/05/11/1733008.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值