0

I am creating an automation(for Chrome browser) using Selenium 3.4 in c# in which I have a Url that displays JSON content when it load.also, the JSON Url takes a lot of time as it contains around 22MB of data.I want to save that JSON content to a file(like text or CSV).I came across a code

using (StreamWriter file = File.CreateText(@"D:\path.txt"))
{
     JsonSerializer serializer = new JsonSerializer();
     serializer.Serialize(file, _data);
}

but it is showing JsonSerializer is not accessible due to protection level.I am writing this inside main method which is also public.

thanks in advance.

0 Answers0