views:

673

answers:

4

I've got a Excel VSTO 2005 application I need to debug, I've tried attaching to the process EXCEL.EXE in Visual Studio 2005 to no avail.

Does anyone know what to do in order to debug managed code running in a VSTO Excel Application?

+1  A: 

I haven't worked with Excel, but with VSTO in Word, attaching the debugger to the WINWORD process works, but makes it impossible to debug startup code, as it has already ran before you can attach. In this case you can insert

Debugger.Launch();

which will stop your code and ask to attach a debugger. It's about the best solution I could find.

Josh
A: 

I was using VS2008 and VSTO 2005 (Office 2003), and I can debug directly from VS itself. Not quite sure about VS2005, I assume it should be the same.

faulty
You can debug as well using Using VS2005 (Office 2007)
Ahmad
A: 

I have done this, it should be no different from Word. Check if you have multiple processes. Ensure that your add-in is actually loaded. It may be banned from starting. Check settings under Add-Ins and see if it is listed as deactivated.

Øyvind Skaar
A: 

I usually include a "StopSwitch" which launches the debugger when the stop-switch is enabled in the app.config file.

After enabling the StopSwitch, sometimes the JIT Debugger is not launch because the problem occurs before the .NET Framework loads the assembly and executes the Stop statement.

AMissico