开发者

Debugging into COM from MSTest

Trying to debug a COM dll written in C++ from with an mstest ru开发者_运维百科n (Visual Studio 2008). All projects are in the same solution. 3 Projects: C++ COM dll, VB.NET WinForms App, C# MSTest Project.

If I run a VB.NET Forms application I can successfully break and step into the COM dll. Breakpoints set in the C++ work correctly.

The problem comes when trying to break and step into from with an MSTest debug session. I can break in the C# test code. However, from within mstest, I cannot step into the COM dll. The breakpoint set in the C++ also never gets hit. The debug into unmanaged code checkbox is checked in the project debug properties.

Tried so far:

  1. Disabling Test Deployment: no effect
  2. Added a unit test to the VB.NET forms app. When running that as a unit test, it does not break or step into either, so it isn't a difference in project or reference.
  3. Tried attaching to the vstesthost process from the COM DLL's properties, but get an error: "Unable to attach. An attempt was made to perform an initialization operation when initialization has already been completed."

Has anyone encountered issues with this in MSTest? Any help would be appreciated!


I am now able to debug into the C++ COM code through MSTest. It seems to be an issue with the button used to run the test. I have found consistently that when running the test using the "Debug Tests in Current Context" button through either the toolbar or menu, I cannot debug into the C++ COM code. However, once the test appears in the Test Results window and I run using the "Debug Checked Tests" button in the toolbar of the Test Results window, I am able to debug into the C++ COM code successfully...

I have no idea why this is, but the only thing I have modified (and changed back) while doing this was the Solution platform, but the above statement holds true in both .NET and Mixed Platforms modes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜