Attaching Visual Studio 2010 to Outlook 2010 plugin for Debugging

I was trying to attach a debugger to an Outlook plugin I was working on. It was originally written for Outlook 2003, but has been progressively upgraded to 2010. However, I couldn’t breakpoint my code, or rather, the breakpoints weren’t being hit.

Found the answer on Stack Overflow:

So it turns out that Outlook doesn’t load the CLR on startup (it must be loaded shortly thereafter when it becomes necessary), which apparently confuses the VS debugger and causes it to only debug native code. To force it to load the CLR immediately, create an OUTLOOK.EXE.config file in the same folder with:

<configuration> <startup> <supportedRuntime version="v2.0.50727"/> </startup></configuration>

which is from this blog post. Then, even when VS starts attached, it will debug CLR code

Advertisements
Attaching Visual Studio 2010 to Outlook 2010 plugin for Debugging

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s