Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Scripting ReadAllBytes & WriteAllBytes Error

Discussion in '5.3 Beta' started by GregMeach, Oct 13, 2015.

  1. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    U5.3 beta 2 on Mac OS X 10.11
    New project
    Imported my screenshot package
    Compiler error:
    Code (CSharp):
    1.  error CS0117: `System.IO.File' does not contain a definition for `ReadAllBytes'
    Which when editing in MonoDevelop it shows the code completion block:

    I get a similar error for 'WriteAllBytes' in an existing project which prompted me to create a new empty project.

    I also got the "cannot contain spaces in project path" (paraphrasing) when I first launched 5.3b2 so my test project has no spaces.

    A quick view of this forum did not yield any similar problems.

    Oh and this code works fine in 5.0 -> 5.2.1p3
    Solutions or workarounds??
     

    Attached Files:

  2. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    Usually I see this error when the project's target platform is set to Webplayer, because ReadAllBytes/WriteAllBytes is not available on Webplayer. Which platform is your project set to?
     
    GregMeach likes this.
  3. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    I can confirm that, on Windows, target set to Windows, empty project.
     
  4. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    And you both have the Windows runtime support module installed?
     
  5. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    YES and I missed the (quite) large button that said "Download Installer" <- sorry :(
    Installing now - will post back results

    Edit: Works fine now - let's just go ahead and rename my account to DOFUS :rolleyes:
     
    Last edited: Oct 13, 2015
    superpig likes this.
  6. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Yes, I have. It works in one project and doesn't if I copy it into another, but since I have probably another problem with materials I told unity to reimport everything and that takes a while. I will file a bug report as soon as I can.