Debugging VB6 Code From Visual Studio 2012

99封情书 提交于 2021-02-04 10:51:12

问题


We have a .NET application using a lot of legacy components written in VB6. We were able to debug the VB6 code using native code debugger and generated pdb files in Visual Studio 2010. After upgrading to the VS 2012 (including Update 2) we cannot do this.

The module window shows following message:

Binary was not built with debug information.

You can also find following message in the output window:

Module was built without symbols.

When I try to load symbols manually, I get following message:

A matching symbol file was not found in this folder.

Debugging the very same dll or exe from VS 2010 works fine.

Is there any option to enable it?


回答1:


I found a solution that works on my machine (per Microsoft's comments on ScottG's paid support request - thanks, Scott). Apparently Visual Studio's default debugger after 2010 doesn't handle VB6 DLLs, but there's a checkbox to use the old debug engine, which does:

enter image description here

I didn't need to enable Native Edit and Continue.




回答2:


I have finally found how to enable debugging VB6 components using Visual Studio 2012. In short, you have to enable the old pdb format first by setting Options | Debugging | Edit and Continue | Enable native Edit and Continue and then you can attach to the dllhost.exe as usually.




回答3:


In VS 2015 Tools->Options->Debugging->General, select 'Use Native Compatibility Mode'. It sucks that I still need to debug VB6, but I am thankful that I am still able to.




回答4:


it seems that VS 2012 use msdia110.dll to decode symbol files, there's a DIA SDK sample in VS folder, you can test whether it can parse those VB pdb files. if it can't, i guess the new version DIA does not support old version pdb any more.



来源:https://stackoverflow.com/questions/16418056/debugging-vb6-code-from-visual-studio-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!