The following is the code :
Dim x As New Google.Apis.Calendar.v3.Data.EventAttendee
x.Email = "xxccxxxxx@gmail.com"
x.DisplayName = "xxxxx"
x.ResponseStatus = "Aproveed"
Dim y As New Google.Apis.Calendar.v3.Data.EventAttendee
y.Email = "xxxxxxx@gmail.com"
y.DisplayName = "suji"
y.ResponseStatus = "Aproveed"
Dim attndList As New List(Of EventAttendee)
attndList.Add(x)
attndList.Add(y)
Dim googleCalendarEvent As New [Event]()
googleCalendarEvent.Attendees.Add(y)'<--- throws exception here
googleCalendarEvent.Attendees.Add(x)
Exception details: Object reference not set to an instance of an object
. why this is happening? how can i overcome this?
Updates when i use like:
Dim googleCalendarEvent As New [Event]()
googleCalendarEvent.Attendees = New EventAttendee()
it shows the error as
Unable to cast object of type 'Google.Apis.Calendar.v3.Data.EventAttendee' to type 'System.Collections.Generic.IList`1[Google.Apis.Calendar.v3.Data.EventAttendee]'.