Search Unity

Class library assembly working in Unity but not in VS2017

Discussion in 'Scripting' started by dri_richard, Jan 18, 2019.

  1. dri_richard

    dri_richard

    Joined:
    Mar 10, 2017
    Posts:
    153
    We're exploring using Zip files in our project (whether or not this is the right thing to do is another discussion!) The class of interest is System.IO.Compression.ZipArchiveEntry

    Following the instructions at https://docs.unity3d.com/Manual/dotnetProfileAssemblies.html and
    https://docs.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017 we've created a response file whose contents are:

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

    Unity itself is then perfectly happy with references to ZipArchiveEntry, but VS2017 complains:
    error CS1069: The type name 'ZipArchiveEntry' 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.

    The scripting runtime is set to .NET 4.x Equivalent, backend is IL2CPP and API compatibility .NET 4.x
     
  2. dri_richard

    dri_richard

    Joined:
    Mar 10, 2017
    Posts:
    153
    Surprised that nobody else has run into this. I tried upgrading to the latest 2019.11 alpha to no avail. Can't work out if it's a problem with Visual Studio itself, or the solution file created by Unity.