Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calendar deserialize failed because of blanks #347

Open
HolzetheKid opened this issue Nov 30, 2017 · 3 comments
Open

calendar deserialize failed because of blanks #347

HolzetheKid opened this issue Nov 30, 2017 · 3 comments
Labels

Comments

@HolzetheKid
Copy link

Hallo,
the following calendar string fails with exception message
System.Runtime.Serialization.SerializationException: 'Expected 'END: VCALENDAR', found 'END:VCALENDAR''

--> do you see that he is expecting a blank( " ") after the ":" ? why ?

using current version:

using Ical.Net;
using Ical.Net.Serialization;
using System.IO;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {

            string calendarstr ="BEGIN: VCALENDAR\r\nVERSION: 2.0\r\nPRODID: -//MailClient.VObject/7.1.30794.0\r\nMETHOD:REQUEST\r\nBEGIN:VTIMEZONE\r\nTZID:W. Europe Standard Time\r\nX-EM-DISPLAYNAME:(UTC+01:00) Amsterdam\\, Berlin\\, Bern\\, Rom\\, Stockholm\\, \r\n Wien\r\nBEGIN:STANDARD\r\nTZNAME:Mitteleuropäische Zeit\r\nDTSTART:00010101T030000\r\nTZOFFSETFROM:+0200\r\nTZOFFSETTO:+0100\r\nRRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10\r\nEND:STANDARD\r\nBEGIN:DAYLIGHT\r\nTZNAME:Mitteleuropäische Sommerzeit\r\nDTSTART:00010101T020000\r\nTZOFFSETFROM:+0100\r\nTZOFFSETTO:+0200\r\nRRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3\r\nEND:DAYLIGHT\r\nEND:VTIMEZONE\r\nBEGIN:VEVENT\r\nUID:99ca3cae-227a-424c-8d97-7b11d7c7aae9\r\nSEQUENCE:1\r\nDTSTART;TZID=W. Europe Standard Time:20171130T080000\r\nDTEND;TZID=W. Europe Standard Time:20171130T083000\r\nTRANSP:OPAQUE\r\nX-MICROSOFT-CDO-BUSYSTATUS:BUSY\r\nLAST-MODIFIED:20171127T210957Z\r\nDTSTAMP:20171127T210955Z\r\nCREATED:20171127T210955Z\r\nSUMMARY:rsponse test\r\nDESCRIPTION:response test\r\nLOCATION:dsfgj\r\nATTENDEE;[email protected];RSVP=TRUE:mailto:xxxxx@freen\r\n et.de\r\nORGANIZER;CN=xxxx xxxxx:mailto:[email protected]\r\nCLASS:PUBLIC\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n\r\n";
                      
            var iCal = Calendar.Load(calendarstr);
        }
    }
}

@rianjs
Copy link
Collaborator

rianjs commented Nov 30, 2017

It’s probably expecting the tokens to match exactly. Your BEGIN token has a space (‘BEGIN: VCALENDAR’) but the end doesn’t match.

The right thing to do would be throw a SerializationException in the event of an invalid space like you have on the first line.

@HolzetheKid
Copy link
Author

ok, so i need to verify if the string i good before parsing.

thanks for the information

@rianjs
Copy link
Collaborator

rianjs commented Nov 30, 2017

Reopening because this should fail to parse the first token, so it’s a bug.

@rianjs rianjs reopened this Nov 30, 2017
@axunonb axunonb added the bug label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants