Useless F5 to start debug of COM add-in

Add-in Express™ Support Service
That's what is more important than anything else

Useless F5 to start debug of COM add-in
Symbols don't load 
David Ching


Guest


Hello, I am using VS2010 Ultimate to write an Excel COM add-in using Add-In Express 2010. I am using .NET 2.0.

In the Debug Properties of my C# project, I set the "Start external program" to "D:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE". I also check the box "Enable Unmanaged code debugging" which is necessary because EXCEL.EXE is unmanaged.

When I press F5 to start debugging, Excel is started, and my add-in DLL is loaded and visible in VS Debug | Windows | Modules. However, the symbol status column says, "No native symbols in symbol file." It looks like the debugger is thinking that since EXCEL.EXE is native, then only native symbols should be used for the add-in! Since no symbols are loaded, I can't debug my add-in.

I have debugged my add-in by running EXCEL.EXE normally, then in VS doing a Tools | Attach To Process. This then loads my add-in symbols fine and I can debug. But it is kind of a pain to start debugging this way.

Is there anyway to set up VS to be able to debug a managed add-in with F5?

Thanks,
David
Posted 01 Sep, 2010 20:40:50 Top
Eugene Astafiev


Guest


Hi David,

Sure. Please check out the target framework (CLR) of your add-in project.

I have just created a new sample project (a COM add-in for Excel). Created a breakpoint in the AddinStartupComplete event handler and pressed F5 to start debugging. Unfortunately I couldn't reproduce it on my PC. But I've noticed that if I change the target framework of my add-in to the .net framework 3.5 (CLR 2.0) or below the breakpoint is not working anymore.

However, if you want to debug the add-in with target framework lower than 4.0 you need to set the according CLR version for the host application (please see the Host Application dialog on the screenshot, you can run it using the context menu of add-in module designer)

User added an image

Please read more about this issue in the http://blogs.msdn.com/b/mshneer/archive/2010/03/19/com-shim-wizards-for-vs-2010.aspx article.
Posted 02 Sep, 2010 04:44:44 Top
David Ching


Guest


Thanks Eugene. You rock! :-) It works terrific.

Thanks again,
David
Posted 02 Sep, 2010 13:35:22 Top
Eugene Astafiev


Guest


Hi David,

You are welcome! It is just my job :-)
Posted 03 Sep, 2010 03:04:07 Top
JC_Miami




Posts: 1
Joined: 2010-09-10
I upgraded my developing machine from Outlook 2007 to Outlook 2010 and my breakpoints were not being "hit" when debugging.
This fix to change the host configuration worked for me as well :)
Posted 10 Sep, 2010 10:03:02 Top