Click here to Skip to main content
15,902,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Using when i am loading the Vcalendar it is giving me parsing error. This is failing as the content inside should be with proper space. If i manually update with space it works fine. But is there any way to update the format of the Vcalendar file.
Error:
System.Runtime.Serialization.SerializationException: 'Could not parse line: '<br>''



Code:

C#
using (var stream = FileEx.OpenRead(this.path))
{
var calendar = Ical.Net.Calendar.Load(stream);
}


What I have tried:

Tried to encode html using below code but still getting the error "System.Runtime.Serialization.SerializationException: 'Could not parse line: '<br>''
"

C#
StreamReader reader = new StreamReader(@"D:\ICS\2.ics");
        string key = reader.ReadToEnd();

       
        char[] chars = System.Web.HttpUtility.HtmlEncode(key).ToCharArray();

       
        byte[] array = Encoding.ASCII.GetBytes(chars);
                using (MemoryStream stream = new MemoryStream(array))
                {
                    var calendar = Ical.Net.Calendar.Load(stream);
                }
Posted
Updated 14-Mar-19 3:21am
v6
Comments
Richard MacCutchan 14-Mar-19 4:36am    
Please edit your question and remove all the text that is not part of the problem, and add proper <pre> tags round each separate part. As it stands it is impossible to see what is part of your code and what is the part of the text causing the problem, or what the actual problem is.
F-ES Sitecore 14-Mar-19 9:01am    
What is "lcal"?
Richard MacCutchan 14-Mar-19 9:36am    
It's a Github library.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900