我是Visual Studio编程的新手。
我最近将.Net 4.0升级到4.5,以便在System.IO.Compression下使用ZipFile类,但是安装完成后,Visual Studio(我正在使用2012)仍然无法将ZipFile识别为类名。
我确保.Net 4.5出现在“控制面板”程序列表中,并且我的C#解决方案将.Net Framework 4设置为目标框架。
有人可以帮我解决这个问题吗?
最佳答案
请参阅MSDN上的ZipFile Class。它显示所需的框架版本为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/