Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.IO.File' does not contain a definition for `AppendAllText' error in Unity3D?

I am very new to Unity3d and tried to open an existing project. While playing it shows the following error.

Assets/Scripts/DataAccess.cs(39,30): error CS0117: System.IO.File' does not contain a definition forAppendAllText'

I dont have any idea about how to solve this. I get stuck over here.

It would be appreciating if anyone solve this problem.

Thanks in advance...

like image 445
vinothp Avatar asked Dec 20 '22 23:12

vinothp


1 Answers

I ran into this, where no one else on my team could reproduce it.

We are targeting the iOS platform, and for some reason, my Build settings changed magically back to Web Player. Changing this BACK to iOS fixed the issue for me.

On Mac, I went to File ==> Build Settings...

The "Unity" icon was next to Web Player, so I switched it to iOS and hit the "Switch Platform" button. It reimported a bunch of stuff and, when it was done, the compiler error went away.

like image 161
OnlineCop Avatar answered Dec 30 '22 11:12

OnlineCop