Search code examples
asp.netgoogle-calendar-apiicalendar

Why won't Google Calendar load my dynamically generated ICS file?


I've been given the task of creating an ICAL feed of conference calls for members of our organization. I created a handler in ASP.NET that loops through our database, gets the call data from the database, and creates output that appears valid to me based on what I've read of the ICAL format, and the examples I've seen/disassembled.

Outlook 2007 reads the resulting output and displays the calendar, no problem (screenshot here shows how it renders).

30 Boxes also has no problem with it. (see test here).

But when I try to load the same output into Google Calendar, I get the message "We could not parse the calendar at the url requested":

We could not parse the calendar at the url requested

What's wrong with my output that's causing Google to reject it? You can see the temporary data I'm testing with at this URL: http://www.joshuacarmody.com/temp/icaltest.ics. This is a snapshot of the output from my .ASHX file, unaltered except the phone numbers and passcodes have been sanitized.

Edit with additional Info:

I just tried the following

  1. Created a copy of my test file called "icaltest-1googevent.ics"
  2. Deleted all the VEVENT data from the file
  3. Exported one of my Google calendars to ICS
  4. Copied one VEVENT from Google's exported data into my test file
  5. Attempted to subcribe to icaltest-1googevent.ics in Google Calendar.

I still got an error message. So I'm guessing the issue isn't with my VEVENT data, but with something else about the file. Maybe there's something wrong with my VCALENDAR definition?


Solution

  • After lots of trial-and-error, and comparing my output with Google's, I got it working. There were a few problems with my ICS file:

    • Unescaped characters (I didn't know I had to escape commas!)
    • Inconsistent line return characters. They didn't show up in my text editor, but I had to use .NET's String.remove() to remove "\r" from my output to get Google to recognize it
    • The file was missing VCALENDAR:END. Apparently Outlook doesn't much care. Google does.