I am working on reading a json sting in my C# code and run into the error "Illegal characters in path". I did a check on the json string if it adheres to the standards and no issue there. But, when I try to read this data in my code inexplicably run into this error. I'm using this to process my json string.
JSON:
[{ "Id": 1, "FirstName": "Jason1", "LastName": "Test1", "Email": "[email protected]", "Eligible": true, "InsertLogtime": "2022-02-21T00:51:59.917", "Comment": null }, { "Id": 2, "FirstName": "Jason2", "LastName": "Test2", "Email": "[email protected]", "Eligible": true, "InsertLogtime": "2022-02-21T00:51:59.917", "Comment": null } ] C#:
string jstring = @"[{ "Id": 1, "FirstName": "Jason1", "LastName": "Test1", "Email": "[email protected]", "Eligible": true, "InsertLogtime": "2022-02-21T00:51:59.917", "Comment": null }, { "Id": 2, "FirstName": "Jason2", "LastName": "Test2", "Email": "[email protected]", "Eligible": true, "InsertLogtime": "2022-02-21T00:51:59.917", "Comment": null } ]"; using (Stream stream = File.OpenRead(jstring)) { } Error:

jstring. I think this is what is causing the issue. DOCS:path String The file to be opened for reading.