1
\$\begingroup\$

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.

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

enter image description here

How can I fix this error?

\$\endgroup\$
2
  • \$\begingroup\$ I personally haven't ever had the need to do anything like this. But did you take a look at this forum post? As it looks like this person had the same problem as you. \$\endgroup\$
    – troien
    Jul 18, 2019 at 8:31
  • \$\begingroup\$ This could be a similar issue when using JSON.Net. Try putting the dll file from the C:\Program Files (x86)\... path into your project folder inside Assets\Plugins. Create the folder Plugins if it does not exist. I can add this as an answer if it works for you \$\endgroup\$
    – Shraa1
    Jul 18, 2019 at 8:42

1 Answer 1

3
\$\begingroup\$

I had the same problem.

Try to replace the

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

with

-r:System.IO.Compression.dll

in the crc.rsp file.

P.S.

You can also try to add

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

to that file too.

\$\endgroup\$
1
  • \$\begingroup\$ you are a genius! \$\endgroup\$
    – Summer Sun
    Apr 7, 2022 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .