I'm trying to use the following code to read OSM PBF file:
string filePath = DownloadFile(textBoxInput.Text);
using (var fileStream = new FileInfo(@filePath).OpenRead())
{
var source = new PBFOsmStreamSource(fileStream);
foreach (var element in source)
{
//Console.WriteLine(element.ToString());
}
}
but I get an exception as you can see in the attached file.

I'm trying to use the following code to read OSM PBF file:
but I get an exception as you can see in the attached file.