我是 Visual Studio 编程的新手。
我最近将 .Net 4.0 升级到 4.5 以使用 System.IO.Compression 下的 ZipFile 类,但安装完成后,Visual Studio(我使用的是 2012)仍然无法将 ZipFile 识别为类名。
我已确保 .Net 4.5 出现在控制面板程序列表中,并且我的 C# 解决方案将 .Net Framework 4 设置为目标框架。
谁能帮我解决这个问题?
最佳答案
参见 ZipFile Class在 MSDN 上。它显示所需的框架版本是 4.5。框架版本固定后,检查您是否添加了对 System.IO.Compression.FileSystem.dll
程序集的引用,并向您的程序集添加了一个 using System.IO.Compression
指令类。
关于c# - 已安装 .Net 4.5 但无法在 Visual C# 中使用 ZipFile 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14218602/