visual studio 无法识别 ZipFile Class

ZipFile Class not recognised by visual studio

我正在尝试使用 ZipFile.OpenRead() 但问题是无论我尝试多少它都无法在程序中工作,无论我使用什么 nugetpackage 或代码。

我尝试了 System.IO.Compression.ZipFile.OpenRead() 这没有用,相反 visual studio.

要求我使用 ZipArchive

我导入了 System.IO.Compression.ZipFile 和 System.IO.Compression nuget 包,但仍然没有任何变化,我还能做什么?

代码在这里:Link,行号。 167.

您需要在项目中添加对 System.IO.Compression.FileSystem 的引用才能获得 System.IO.Compression.ZipFile