System.IO.File does not contain a definition for 'WriteAllLines'

Basically, I’m exporting my game for Webplayer and I need a persistent place to write my data to, so I’ve chosen the Application.persistentDataPath in the AppData for that, since that made the most logical sense.

I think that’s all fine and dandy, but the problem i’m getting is the following:

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

Which is this line of code:

File.WriteAllLines(Application.persistentDataPath + "/GameData.txt", GameData);

I have “using System.IO;” in the top of my document, and I’ve been using it to read without any problems so it’s not that.

Can anyone help?

The WebPlayer is sandboxed, so you are very limited on I/O. I believe that WriteAllBytes() (as well as other file i/o functions) is unavailable for a web build.