Search

Debugging an MMC snapin does not attach correctly to mmc.exe by SvenC

Active

6
0
Sign in
to vote
Type: Bug
ID: 551449
Opened: 4/15/2010 7:51:11 AM
Access Restriction: Public
1
Workaround(s)
4
User(s) can reproduce this bug
I develope a managed MMC3 snapin and converted that project from vs2008 to vs2010. The target framework is 3.5 with AnyCPU and the snap in built with vs2010 runs as expected.

As the snapin is a class library project I need a host process to debug it.
I specified c:\windows\system32\mmc.exe.
When pressing F5 mmc.exe gets started (vs2010 is started on Win7 x64 with admin privileges). It look like the debugger is attached as I can enable break points in my code but those break points are not hit.

When I detach VS2010 from MMC and attach again the break points are hit.
In vs2008 it works using F5, no need to detach/attach manually.
Details (expand)

Product Language

English

Visual Studio Version

Visual Studio 2010

Operating System

Windows 7

Operating System Language

English

Steps to Reproduce

Start VS 2010 as admin

Create a managed class library which implements an MMC3 snapin (I attached a minimal sample)

Install the snapin dll.

Set a break-point in the constructor of the main Snapin class

Set mmc.exe as debug target in the project settings. Press F5.

Add your MMC snapin and see that your break point is not hit.

Use "Detach all" to let mmc.exe run but detach VS from it

Manually attach to mmc.exe - be sure to attach for Managed 2.0 code

Add your snapin another time to the mmc and see that your break point is hit

Actual Results

F5 debugging of class library does not correctly attach to the debug host process

Expected Results

F5 should attach correctly to the host process so that I can debug my class library code
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey.

 

File Attachments
File Name Submitted By Submitted On File Size  
mmcTest.zip 4/15/2010 2 KB
Sign in to post a comment.
Posted by Microsoft on 5/20/2010 at 3:10 PM
Thank you for your feedback. We are taking a look at this right now. This is a dupe of another bug that we are using for tracking purposes. Thus, I am duping this bug to that one so as to maintain a single bug on this issue.
Posted by SvenC on 5/11/2010 at 11:19 PM
Thank's for the workaround. Adding an mmc.exe.config with this contents does fix the problem:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727" />
</startup>
</configuration>
Posted by Microsoft on 5/11/2010 at 7:04 PM
Hello,

We are currently working on fixing this issue. In the meantime, please see the following blog entry for an explantion and the workaround: http://blogs.msdn.com/debugger/archive/2010/04/30/can-t-hit-breakpoints-in-a-plug-in-or-can-t-debug-net-2-0-3-0-3-5-from-a-mixed-mode-exe-project-with-visual-studio-2010.aspx

Best Regards,
Visual Studio Debugger
Posted by gbreder2 on 4/16/2010 at 7:59 AM
I can reproduce the behavior too. If the solution will be started with CTRL + F5 I can attach to my code through a Debugger.Launch(). The command Debugger.Breack() does not start the VisualStudio debugging Mode.
Posted by Microsoft on 4/16/2010 at 12:47 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you
Posted by Microsoft on 4/16/2010 at 12:47 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you
Sign in to post a workaround.
Posted by Andrew B Hall - MSFT on 5/12/2010 at 9:51 AM
See blog entry: http://blogs.msdn.com/debugger/archive/2010/04/30/can-t-hit-breakpoints-in-a-plug-in-or-can-t-debug-net-2-0-3-0-3-5-from-a-mixed-mode-exe-project-with-visual-studio-2010.aspx