- Home /
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?
Answer by robertbu · Apr 20, 2014 at 08:59 PM
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.
Awesome mate.. Nothing else but to go the Database way then.. Thanks ;)
Your answer
Follow this Question
Related Questions
File exists not working applicationDataPath 1 Answer
How to delete everything at Application.persistentDataPath? 3 Answers
Multiple Lists to CSV in C# 0 Answers
Will System.IO.File work on Macs 2 Answers
Multiple Cars not working 1 Answer