com exceptions thrown on _MailItem.Get_EntryID() when hot syncing

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

com exceptions thrown on _MailItem.Get_EntryID() when hot syncing
 
Jim Erwin




Posts: 23
Joined: 2006-10-09
Hi,

I have been using Add-In Express for about 2 months now on an Outlook add-in. Overall, this has been a pleasant experience. I don't think the issue I've come across is specific to Add-In Express, but I'm hoping somebody in this forum has already run into and found an approach to resolve this issue.

The Outlook Add-In I've developed for a client has been deployed on about 70 desktops and a Citrix server. The add-in has been developed using Visual Studio 2005 / C# / Add-In Express .NET 2.7. The deployment target machines are a mix of Windows XP Pro SP2 running Office XP Professional but running Outlook 2003 as the Exchange client connected to an Exchange 2003 server.

I am currently handling the InspectorActivate event. When it activates, one of the things I need to check for is the EntryID if it's a MailItem. This works very well most of the time, but when it runs on desktops with smart devices attached and it appears that a hot-sync is happening at the time, checking the EntryID Property generates the following com exception.

---------------------------

Gsc.Jobs.JobMailOperationException: An error occurred during the auto-archive check ---> System.Runtime.InteropServices.COMException (0xA0F4010F): The operation failed.

at Microsoft.Office.Interop.Outlook._MailItem.get_EntryID()
at Gsc.MsOffice.MsOutlook.JobMailItemHelper.IsUnProcessedInboxMailItem(MailItem mailItem, MAPIFolder inboxFolder)
at Gsc.MsOffice.MsOutlook.AddIn.Project.AddinModule.adxOutlookEvents_InspectorActivate(Object sender, Object inspector, String folderName)

-----------------------------

I know I could throw a try-catch around the one line that actually checks for the EntryID, but the problem is that if it fails and it is an item that should be processed, it may not get processed. Additionally, the add-in sometimes just stops responding after this particular error.

This is the third release for this add-in, and the first feature causing any kind of issue like this. I was hoping that somebody else might have come across a similar issue and would have a resolution.

regards,

JE





Posted 09 Oct, 2006 17:37:36 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Jim.

Do you have both Outlook XP and Outlook 2003 installed on the deployment PC?
Posted 10 Oct, 2006 15:47:33 Top
Jim Erwin




Posts: 23
Joined: 2006-10-09
Sergey,

First, in reply to your question, at least one of the target PCs only has Outlook 2003 installed. Luckily for me, we also manage a great deal of the infrastructure services for the client I developed this add-in for, so I can get full listings of all hardware and software for any computer in their Enterprise.

There are a number of deployment PCs experiencing the problem. At this point, I should simply rename this thread because it's also gone well beyond just hot-syncing PCs. Originally, only PCs that hot-synced with smart phones were experiencing issues.

Here's what has happened since my last post.

The original testers still have yet to have a crash on their desktops. Most other users are experiencing issues, some to the point where almost any e-mail they open will end up crashing outlook.

Due to the fact that some of the MailItems that were being opened needed to be copied to multiple public folders, and one of those multiple folders could end up throwing an exception when being copied to due to permissions issues, I implemented exception handling around each and every copy to a public folder. For each copy that throws an exception, I store a custom exception that also has the folder name it failed to copy to attached as well as the inner exception. I add each exception to a generic List of these exceptions and return the list as the return type of the method that copies the MailItems to the public folders.

If the list is not empty when it gets back to the calling method, the calling method displays a modal form with a list of the public folders the MailItem was not copied to. The user can cancel the modal form, or click a "Copy Error to Clipboard" button that copies all of the information to the clipboard (stack traces, exception messages, etc...) and the closes the form.

I now have two issues I'm dealing with.

1. There are com exceptions regularly being thrown by Outlook when performing various operations.

2. My exception handling "Copy Error to Clipboard" button is also causing Outlook to completely crash on a consistent basis, so I can't get the information I need to more accurrately diagnose the issue.

I was in a class for 2 days, so this is the first day I'm back to working on this issue. My immediate plan of action is to remove my exception handling and just let Add-In-Express' built in exception handling handle the exceptions occurring while trying to copy messages. The only real issue I see there is that for MailItems that should be copying to multiple folders that fail for only some of the folders, I may either get the messages being copied to some of the folders, or I may get duplicates if the copy is tried again.

On the Terminal Server the add-in is depoloyed on, I get a number of Outlook warnings in the application event log that tell me something is wrong, but not what.

Event Type: Warning
Event Source: Outlook
Event Category: None
Event ID: 25
Date: 10/11/2006
Time: 5:51:46 PM
User: N/A
Computer: GENESYS02
Description:
The operation failed.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Of course, you go the the help and support center and they say they have no information on this.

I'm hoping that changing back to using the default add-in-express exception handling form at least "stems the bleeding" for the moment, but there has to be something beyond that where I can actually stop getting these exceptions.

I'll post my progress here later today, but I still need help getting the initial exceptions resolved. I can't imagine why a simple property check for the EntryID on a MailItem should result in a com exception being thrown.

regards,

JE
Posted 13 Oct, 2006 09:58:56 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Jim.

One more question. Does the same problem appear as well on the PC with Outlook 2003 installed only?
Posted 13 Oct, 2006 11:59:22 Top
Jim Erwin




Posts: 23
Joined: 2006-10-09
Sergey,

There are no PCs at the client that are not a combination of Office XP/Outlook 2003. They have a large number of Access applications that are currently all written in Access 2002. That's a major reason why they are still on Office XP. The last Access upgrade caused a tremendous amount of effort from their Access developer to fix a ton of bugs caused by their last upgrade.

I have been unable to recreate the errors on either my development virtual machine (Windows XP Pro SP2/Office 2003/Visual Studio 2005 Team Suite), my deployment test virtual machine (Windowx XP Pro SP2/Office XP/Outlook 2003) or my virtual terminal server test deployment virtual machine (Windows 2003 Server SP1/Office XP/Outlook 2003).

regards,

JE
Posted 13 Oct, 2006 12:45:40 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Jim, do you use PIAs for Office XP in the add-in project?
Posted 13 Oct, 2006 12:57:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Jim, what about Outlook XP.
Is it installed as well on the client's PCs?
Posted 13 Oct, 2006 13:06:53 Top
Jim Erwin




Posts: 23
Joined: 2006-10-09
Jim, do you use PIAs for Office XP in the add-in project?


I didn't think to add PIAs for OfficeXP in the add-in project. I'm not totally sure which assemblies are the PIAs and how I would differentiate between Office 2003 and Office 2002 PIAs. Here is a list of my current references from the project file.

<pre>
<ItemGroup>
<Reference Include="AddinExpress.MSO.2005, Version=2.7.1762.2005, Culture=neutral, PublicKeyToken=c20c070a1fc9a144, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
<Reference Include="Extensibility, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Office.Interop.Outlook, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<SpecificVersion>False</SpecificVersion>
<HintPath>OfficePIAs\Microsoft.Office.Interop.Outlook.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Vbe.Interop, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<SpecificVersion>False</SpecificVersion>
<HintPath>OfficePIAs\Microsoft.Vbe.Interop.dll</HintPath>
</Reference>
<Reference Include="Office, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<SpecificVersion>False</SpecificVersion>
<HintPath>OfficePIAs\Office.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
</pre>

What course regarding PIAs would you suggest I take? I see the reference for the three Office related assemblies copied to the project\OfficePias folder by Add-In-Express when I created the project. Are there other versions I should be using?

thanks,

JE
Posted 13 Oct, 2006 13:08:44 Top
Jim Erwin




Posts: 23
Joined: 2006-10-09
Jim, what about Outlook XP.
Is it installed as well on the client's PCs?


Outlook XP WAS installed on some but not all of the target PCs prior to the Outlook 2003 install. The standard office configuration is Office XP/ Outlook 2003 (no Outlook XP).

JE
Posted 13 Oct, 2006 13:17:27 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Jim, as far as I see, you use PIAs for Office 2003 (11.0.0.0).
Can you please test the add-in with PIAs (Primary Interop Assembly) for Office XP (Microsoft.Office.Interop.Outlook, Microsoft.Vbe.Interop, Office)?
You can download XP PIAs here:
http://www.microsoft.com/downloads/details.aspx?familyid=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en
Posted 13 Oct, 2006 13:28:26 Top