[GH-ISSUE #308] Impossible to cast object error when synchronizing #766

Open
opened 2026-03-01 17:41:25 +03:00 by kerem · 2 comments
Owner

Originally created by @tech62 on GitHub (Mar 12, 2021).
Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/308

All is in the title
Office version : 2010 x64
CalDavSynchronizer : version 4.0

Thanks for your help

System.InvalidCastException: Impossible d'effectuer un cast d'un objet COM de type 'System.__ComObject' en type d'interface 'Microsoft.Office.Interop.Outlook._ContactItem'. Cette opération a échoué, car l'appel QueryInterface sur le composant COM pour l'interface avec l'IID '{00063021-0000-0000-C000-000000000046}' a échoué en raison de l'erreur suivante : Bibliothèque non inscrite. (Exception de HRESULT : 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
   à System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
   à Microsoft.Office.Interop.Outlook._ContactItem.get_LastModificationTime()
   à CalDavSynchronizer.Implementation.Contacts.ContactEntityMapper.Map1To2(IContactItemWrapper source, vCard target, IEntitySynchronizationLogger logger, ICardDavRepositoryLogger context)
   à GenSync.Synchronization.States.CreateInB`7.<InitializeEntity>d__17.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à GenSync.Synchronization.States.CreateInB`7.JobWrapper.<InitializeEntity>d__5.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à CalDavSynchronizer.Implementation.Contacts.VCardTypeSwitch.TypeFilteringVCardRepositoryDecorator`1.<>c__DisplayClass7_0.<<Create>b__0>d.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à CalDavSynchronizer.Implementation.Contacts.LoggingCardDavRepositoryDecorator.<>c__DisplayClass4_0.<<Create>b__0>d.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à CalDavSynchronizer.Implementation.Contacts.CardDavEntityRepository`3.<Create>d__13.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à CalDavSynchronizer.Implementation.Contacts.LoggingCardDavRepositoryDecorator.<Create>d__4.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à CalDavSynchronizer.Implementation.Contacts.VCardTypeSwitch.TypeFilteringVCardRepositoryDecorator`1.<Create>d__7.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   à GenSync.EntityRepositories.BatchEntityRepositoryAdapter`4.<PerformOperations>d__3.MoveNext()
Originally created by @tech62 on GitHub (Mar 12, 2021). Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/308 All is in the title Office version : 2010 x64 CalDavSynchronizer : version 4.0 Thanks for your help ``` System.InvalidCastException: Impossible d'effectuer un cast d'un objet COM de type 'System.__ComObject' en type d'interface 'Microsoft.Office.Interop.Outlook._ContactItem'. Cette opération a échoué, car l'appel QueryInterface sur le composant COM pour l'interface avec l'IID '{00063021-0000-0000-C000-000000000046}' a échoué en raison de l'erreur suivante : Bibliothèque non inscrite. (Exception de HRESULT : 0x8002801D (TYPE_E_LIBNOTREGISTERED)). à System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease) à Microsoft.Office.Interop.Outlook._ContactItem.get_LastModificationTime() à CalDavSynchronizer.Implementation.Contacts.ContactEntityMapper.Map1To2(IContactItemWrapper source, vCard target, IEntitySynchronizationLogger logger, ICardDavRepositoryLogger context) à GenSync.Synchronization.States.CreateInB`7.<InitializeEntity>d__17.MoveNext() --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) à GenSync.Synchronization.States.CreateInB`7.JobWrapper.<InitializeEntity>d__5.MoveNext() --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) à CalDavSynchronizer.Implementation.Contacts.VCardTypeSwitch.TypeFilteringVCardRepositoryDecorator`1.<>c__DisplayClass7_0.<<Create>b__0>d.MoveNext() --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) à CalDavSynchronizer.Implementation.Contacts.LoggingCardDavRepositoryDecorator.<>c__DisplayClass4_0.<<Create>b__0>d.MoveNext() --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) à CalDavSynchronizer.Implementation.Contacts.CardDavEntityRepository`3.<Create>d__13.MoveNext() --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) à CalDavSynchronizer.Implementation.Contacts.LoggingCardDavRepositoryDecorator.<Create>d__4.MoveNext() --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) à CalDavSynchronizer.Implementation.Contacts.VCardTypeSwitch.TypeFilteringVCardRepositoryDecorator`1.<Create>d__7.MoveNext() --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() à GenSync.EntityRepositories.BatchEntityRepositoryAdapter`4.<PerformOperations>d__3.MoveNext() ```
Author
Owner

@bw210343 commented on GitHub (Jan 31, 2025):

Had a similar issue with Office 2013 after downgrading from 365. This worked for me:

https://support.boyum-it.com/hc/en-us/articles/206772337-Outlook-issue-Unable-to-cast-COM-object-of-type-Microsoft-Office-Interop-Outlook-ApplicationClass

Close all Office applications (Outlook, Word, Excel).
Click your Windows Start button, either click Run or go to the Search box on the Start Menu, and type regedit. The Windows registry editor opens.
Navigate to the following key: HKEY_CLASSES_ROOT\TypeLib{00062FFF-0000-0000-C000-000000000046}\9.6
Delete the 9.6 key.
Close the registry editor.

<!-- gh-comment-id:2627196518 --> @bw210343 commented on GitHub (Jan 31, 2025): Had a similar issue with Office 2013 after downgrading from 365. This worked for me: https://support.boyum-it.com/hc/en-us/articles/206772337-Outlook-issue-Unable-to-cast-COM-object-of-type-Microsoft-Office-Interop-Outlook-ApplicationClass Close all Office applications (Outlook, Word, Excel). Click your Windows Start button, either click Run or go to the Search box on the Start Menu, and type regedit. The Windows registry editor opens. Navigate to the following key: HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.6 Delete the 9.6 key. Close the registry editor.
Author
Owner

@tech62 commented on GitHub (Feb 3, 2025):

Thanks for your reply, unfortunaly too late, i hope your answer can help someone ^^ =)

<!-- gh-comment-id:2630314974 --> @tech62 commented on GitHub (Feb 3, 2025): Thanks for your reply, unfortunaly too late, i hope your answer can help someone ^^ =)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/outlookcaldavsynchronizer#766
No description provided.