[GH-ISSUE #195] System.InvalidCastException: Das Objekt des Typs "System.String" kann nicht in Typ "System.Byte[]" umgewandelt werden. #1092

Closed
opened 2026-03-14 00:15:35 +03:00 by kerem · 3 comments
Owner

Originally created by @gjuecat on GitHub (May 15, 2017).
Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/195

Hi,

I'm using the synchronizer for some month to sync Outlook to Baikal to smartphone (2 way). Since some days I get some sync errors for contacts, as far as I have found out mostly for contacts which I called with my phone.
<?xml version="1.0" encoding="utf-16"?> <SynchronizationReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ProfileName>Kontakte Firma</ProfileName> <ProfileId>8fcd0681-1738-4a5b-bfb6-3878bf01bd87</ProfileId> <StartTime>2017-05-15T04:15:42.4661264Z</StartTime> <ADelta>Unchanged: 125 , Added: 0 , Deleted 0 , Changed 1</ADelta> <BDelta>Unchanged: 124 , Added: 0 , Deleted 0 , Changed 2</BDelta> <AJobsInfo>Create 0 , Update 0 , Delete 0</AJobsInfo> <BJobsInfo>Create 0 , Update 0 , Delete 0</BJobsInfo> <LoadErrors> <LoadError> <EntityId>/dav.php/addressbooks/Stuetz/juergenfirma/9ca3ff16-a75c-4f42-a565-094ade8af986.vcf</EntityId> <Error>System.InvalidCastException: Das Objekt des Typs "System.String" kann nicht in Typ "System.Byte[]" umgewandelt werden. bei Thought.vCards.vCardStandardReader.ReadInto_KEY(vCard card, vCardProperty property) bei Thought.vCards.vCardStandardReader.ReadInto(vCard card, vCardProperty property) bei Thought.vCards.vCardStandardReader.ReadInto(vCard card, TextReader reader) bei CalDavSynchronizer.Implementation.Contacts.CardDavRepository1.Deserialize(String vcardData, vCardStandardReader serializer)
bei CalDavSynchronizer.Implementation.Contacts.CardDavRepository1.TryDeserialize(String vcardData, vCard&amp; vcard, WebResourceName uriOfAddressbookForLogging, vCardStandardReader deserializer, ILoadEntityLogger logger)</Error> <IsAEntity>false</IsAEntity> </LoadError> <LoadError> <EntityId>/dav.php/addressbooks/Stuetz/juergenfirma/4b60a692-e810-4874-88b5-9255dd901035.vcf</EntityId> <Error>System.InvalidCastException: Das Objekt des Typs "System.String" kann nicht in Typ "System.Byte[]" umgewandelt werden. bei Thought.vCards.vCardStandardReader.ReadInto_KEY(vCard card, vCardProperty property) bei Thought.vCards.vCardStandardReader.ReadInto(vCard card, vCardProperty property) bei Thought.vCards.vCardStandardReader.ReadInto(vCard card, TextReader reader) bei CalDavSynchronizer.Implementation.Contacts.CardDavRepository1.Deserialize(String vcardData, vCardStandardReader serializer)
bei CalDavSynchronizer.Implementation.Contacts.CardDavRepository1.TryDeserialize(String vcardData, vCard&amp; vcard, WebResourceName uriOfAddressbookForLogging, vCardStandardReader deserializer, ILoadEntityLogger logger)</Error> <IsAEntity>false</IsAEntity> </LoadError> </LoadErrors> <EntitySynchronizationReports /> <ConsiderExceptionThatLeadToAbortionAsWarning>false</ConsiderExceptionThatLeadToAbortionAsWarning> <Duration>00:00:01.3370754</Duration> </SynchronizationReport>

I'm using the latest version of CalDav Synchronizer.

What's wrong?
Thx

Originally created by @gjuecat on GitHub (May 15, 2017). Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/195 Hi, I'm using the synchronizer for some month to sync Outlook to Baikal to smartphone (2 way). Since some days I get some sync errors for contacts, as far as I have found out mostly for contacts which I called with my phone. `<?xml version="1.0" encoding="utf-16"?> <SynchronizationReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ProfileName>Kontakte Firma</ProfileName> <ProfileId>8fcd0681-1738-4a5b-bfb6-3878bf01bd87</ProfileId> <StartTime>2017-05-15T04:15:42.4661264Z</StartTime> <ADelta>Unchanged: 125 , Added: 0 , Deleted 0 , Changed 1</ADelta> <BDelta>Unchanged: 124 , Added: 0 , Deleted 0 , Changed 2</BDelta> <AJobsInfo>Create 0 , Update 0 , Delete 0</AJobsInfo> <BJobsInfo>Create 0 , Update 0 , Delete 0</BJobsInfo> <LoadErrors> <LoadError> <EntityId>/dav.php/addressbooks/Stuetz/juergenfirma/9ca3ff16-a75c-4f42-a565-094ade8af986.vcf</EntityId> <Error>System.InvalidCastException: Das Objekt des Typs "System.String" kann nicht in Typ "System.Byte[]" umgewandelt werden. bei Thought.vCards.vCardStandardReader.ReadInto_KEY(vCard card, vCardProperty property) bei Thought.vCards.vCardStandardReader.ReadInto(vCard card, vCardProperty property) bei Thought.vCards.vCardStandardReader.ReadInto(vCard card, TextReader reader) bei CalDavSynchronizer.Implementation.Contacts.CardDavRepository`1.Deserialize(String vcardData, vCardStandardReader serializer) bei CalDavSynchronizer.Implementation.Contacts.CardDavRepository`1.TryDeserialize(String vcardData, vCard&amp; vcard, WebResourceName uriOfAddressbookForLogging, vCardStandardReader deserializer, ILoadEntityLogger logger)</Error> <IsAEntity>false</IsAEntity> </LoadError> <LoadError> <EntityId>/dav.php/addressbooks/Stuetz/juergenfirma/4b60a692-e810-4874-88b5-9255dd901035.vcf</EntityId> <Error>System.InvalidCastException: Das Objekt des Typs "System.String" kann nicht in Typ "System.Byte[]" umgewandelt werden. bei Thought.vCards.vCardStandardReader.ReadInto_KEY(vCard card, vCardProperty property) bei Thought.vCards.vCardStandardReader.ReadInto(vCard card, vCardProperty property) bei Thought.vCards.vCardStandardReader.ReadInto(vCard card, TextReader reader) bei CalDavSynchronizer.Implementation.Contacts.CardDavRepository`1.Deserialize(String vcardData, vCardStandardReader serializer) bei CalDavSynchronizer.Implementation.Contacts.CardDavRepository`1.TryDeserialize(String vcardData, vCard&amp; vcard, WebResourceName uriOfAddressbookForLogging, vCardStandardReader deserializer, ILoadEntityLogger logger)</Error> <IsAEntity>false</IsAEntity> </LoadError> </LoadErrors> <EntitySynchronizationReports /> <ConsiderExceptionThatLeadToAbortionAsWarning>false</ConsiderExceptionThatLeadToAbortionAsWarning> <Duration>00:00:01.3370754</Duration> </SynchronizationReport>` I'm using the latest version of CalDav Synchronizer. What's wrong? Thx
kerem closed this issue 2026-03-14 00:15:40 +03:00
Author
Owner

@aluxnimm commented on GitHub (May 15, 2017):

Please provide the vcard which causes the error (/dav.php/addressbooks/Stuetz/juergenfirma/9ca3ff16-a75c-4f42-a565-094ade8af986.vcf)
It seems to have an invalid or wrong encoded certificate.

<!-- gh-comment-id:301484814 --> @aluxnimm commented on GitHub (May 15, 2017): Please provide the vcard which causes the error (/dav.php/addressbooks/Stuetz/juergenfirma/9ca3ff16-a75c-4f42-a565-094ade8af986.vcf) It seems to have an invalid or wrong encoded certificate.
Author
Owner

@aluxnimm commented on GitHub (May 18, 2017):

Fixed in 6dcf0ff, will be in next release.

<!-- gh-comment-id:302380586 --> @aluxnimm commented on GitHub (May 18, 2017): Fixed in 6dcf0ff, will be in next release.
Author
Owner

@aluxnimm commented on GitHub (May 18, 2017):

As a workaround meanwhile you can also add
KEY;ENCODING=b;TYPE=X509
to the key attribute

<!-- gh-comment-id:302380874 --> @aluxnimm commented on GitHub (May 18, 2017): As a workaround meanwhile you can also add KEY;ENCODING=b;TYPE=X509 to the key attribute
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#1092
No description provided.