Ошибка в JSONToken
Имеется класс, который должен читать JSON файл и отдавать Словарь с Именем страницы и его URL, которые записаны в JSON. В итоге от выдает ошибку:
The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
Я не могу понять как этот исправить и что за JSON token
internal class ConfigParser
{
public Dictionary<string, string> GetListPages(string fileName)
{
Dictionary<string, string> listPage = new Dictionary<string, string>();
try
{
string json = File.ReadAllText(fileName);
List<PageInfo> pages = JsonSerializer.Deserialize<List<PageInfo>>(json);
foreach (var page in pages)
{
listPage[page.Name] = page.URL;
}
}
catch (JsonException ex)
{
throw new Exception("Ошибка в JSON");
}
catch (IOException ex)
{
throw new Exception("Ошибка в Чтение");
}
return listPage;
}
}
[
{
"Name": "HomePage",
"URL": "https://store.steampowered.com/"
},
{
"Name": "AboutPage",
"URL": "https://store.steampowered.com/about/"
}
]