Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

error CS1069: The type name 'ZipArchive' could not be found in the namespace 'System.IO.Compression'

Discussion in 'Scripting' started by MiaoBolverk, Jul 17, 2019.

  1. MiaoBolverk

    MiaoBolverk

    Joined:
    Feb 6, 2018
    Posts:
    26
    When I build my project, which references the System.IO.Compression namespace, the build succeeds without issue inside Visual Studio.

    However, inside the Unity editor, I see the following error:

    error CS1069: The type name 'ZipArchive' could not be found in the namespace 'System.IO.Compression'. This type has been forwarded to assembly 'System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Consider adding a reference to that assembly.​

    I added a csc.rsp file inside my Assets folder, with the following line:

    -r:System.IO.Compression.FileSystem.dll​

    Unfortunately, that did not resolve the issue.

    For reference, here are the properties of the System.IO.Compression DLL that I reference inside Visual Studio:

    upload_2019-7-17_12-57-36.png

    How can I fix this error?
     
  2. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,893
    Can you check if "Scripting Runtime" in player settings is set to ".net4.x".