Outlook add-in (in C#) causes Outlook 2007 to crash

F

fakeprogress

Hello.

An add-in that was written for Outlook in C# seems to work on Outlook
2000 and Outlook 2003. However, when I installed it on Outlook 2007,
it caused the program to crash, showing me two error messages. First,
"Microsoft Office Outlook has encountered a problem and needs to
close. We are sorry for the inconvenience." Followed by, "Outlook
experienced a serious problem with the add-in. If you have seen this
message multiple times, you should disable this add-in and check to
see if an update is available. Would you like to disable this add-
in?" Once I disable it, Outlook loads normally. (The Event Viewer
shows no messages related to this issue.)

Opening the code for this add-in in Visual Studio 2005 results in four
warnings:
(1) Cannot find wrapper assembly for type library
"Microsoft.Office.Core".
(2) Cannot find wrapper assembly for type library "Outlook".
(3) The referenced component 'Microsoft.Office.Core' could not be
found.
(4) The referenced component 'Outlook' could not be found.

I am completely brand new to programming in C#. I was only recently
added to this project. (That is, I did not write any of the code. I
am actually still a student.) Therefore, I am having difficulties
figuring out what the problem seems to be. How can I make the code
for this add-in compatible with all versions of Outlook?

Thanks,
Allie
 
K

Ken Slovak - [MVP - Outlook]

An addin written for Outlook 2003 will run on Outlook 2007 with no problems
if it has no problems to begin with. Outlook 2000 and 2002 are a bit
different in that the PIA's and the signatures of the PIA's are different
than the signatures for Outlook 2003/2007. In fact, there is no official PIA
for Outlook 2000, you have to modify and rebuild the Outlook 2002 PIA.

If you compile on a machine with Outlook 2003 against the Outlook 2003 PIA
your compiled addin will run correctly on Outlook 2007 except for no support
for anything new.

The reference warnings you are encountering are most likely due to the
original project either being in VS 2003 or referencing an earlier version
of Outlook/Office. To fix that remove the project references that are in
error and then use Add Reference to add back references to Outlook, Office,
etc. from the COM tab of the references dialog.

As far as why your addin is crashing Outlook, that could be due to this or
it could be bad code or code that isn't handling all errors. Hard to say
without knowing the code involved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top