I have had code working for quite some time and now all of a sudden I get all these errors telling me that function are not part of System.
To be more specific.
Assets/CMS/DataStructures.js(501,9): BCE0019: ‘Delete’ is not a member of ‘System.IO.FileInfo’.
What the ?
My player is set to .Net 2.0.
Why is this doing this now?
Ugh,
This has been working for months and now I get all of these compile errors.
This one is most troubling.
Assets/Scripts/AvatarLoad.js(154,56): BCE0019: ‘WriteAllBytes’ is not a member of ‘System.IO.File’.
What is going on?
Any help would be great.
Thanks
change Net2.0 Subset to Net.2.0 in the build settings
Under “Edit->Project Settings->Player” Optimizations Api Compatibility Level is set to .NET 2.0 and has been for months
and youre using System.IO at the top?
Are you building a WebPlayer or a Standalone?
Webplayers can’t use most of System.IO because they are not allowed to write files. The current Target being set to WebPlayer will cause these errors.
I’m not trying to build anything. I’m just trying to get Unity to compile. This same code compiles with out errors in Unity 2.6
Yes Im sure Im using importing “import System.IO;” at the top of the file.
Ok, Looks like I have discovered a bug.
I have two projects that I’m working on. I did a Web build on my other project that does not include these files that I’m getting these compile errors, so it compiled fine and built.
So now I switch back over to my project that includes code that uses System. When I open the project it compiles the scripts and I get the System errors. When I go to the Build Settings of this project it shows that it is set to PC and Mac Standalone but I guess Unity is still thinking it’s set to Web. So I did a build on this project as PC and Mac Standalone and all my errors went away. The part that confused me was that I only Build this project as Standalone and never as web and Unity was showing me that.
Thanks for the help guys. That was very frustrating.