File.ReadAllBytes does not work on mac ?

I’m simply trying to take a screenshot then load it in a byte array, but I get this error:

error CS0117: 'System.IO.File' does not contain a definition for 'ReadAllBytes'

any workarounds to make it work on mac too ?

my code is as simple as this:

Application.CaptureScreenshot("menu.png");
byte[] data = File.ReadAllBytes("menu.png");
bgImage.LoadImage(data);

note - bgImage is a Texture2D.

The problem was my platform was set to Web Player instead of PC & Mac & Linux / Standalone. Hope I helped you if you had the same kind of problem.