the property DicomImage.Dataset was marked obsolete in commit
https://github.com/fo-dicom/fo-dicom/pull/582 due to some multi-threading issues.
I would recommend:
if you are only intereseted in the image, you can call
var img = new DicomImage(filename);
If you also want to access the dataset, I call
var dataset = new DicomDataset(filename);
var img = new DicomImage(dataset);
If you never faced some multi-threading issues, then it would be fine to compile with the errors. I think that was the reason, why the property was only marked as obsolete, to make to make the developer not to use the property if possible. If it was really dangerous, then Anders surely would have made the property private.