BryanWilhite / Songhay.Dashboard

the visual summary of activity in the Songhay System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Newtonsoft.Json.JsonReaderException: Additional text encountered after finished reading JSON content

BryanWilhite opened this issue · comments

this error appears to be a long-time issue I have had when downloading files from Azure with ICloudBlob.DownloadToFileAsync [docs]

at the end of the malformed JSON you should see a chunk of JSON that appears to be from the previous file (which implies that the previous file was larger); i assume that this Azure Storage API call does not erase the contents of the file before writing:

@ref.DownloadToFileAsync(jsonFile, FileMode.Open)

this looks like the way to go:

@ref.DownloadToFileAsync(jsonFile, FileMode.Create)

FileMode.Create [docs]:

Specifies that the operating system should create a new file. If the file already exists, it will be overwritten.