安装了.NET 4.5,但不能在Visual C#中使用的ZipFile类能在、但不、安装了、NET

2023-09-02 02:01:43 作者:笑在眉眼

我是怎样的一个新手到Visual Studio编程。

I'm kind of a newbie to Visual Studio programming.

我最近升级的.Net 4.0到4.5,以使用zip文件类下System.IO.Com pression,但安装完成时,Visual Studio(我用2012)仍然无法识别的ZipFile为后类名。

I recently upgraded .Net 4.0 to 4.5 in order to use the ZipFile class under System.IO.Compression, but after the installation completed, Visual Studio (I'm using 2012) still cannot recognize ZipFile as a class name.

我做了肯定的.Net 4.5出现在控制面板的程序列表和我的C#的解决方案集。NET框架4作为目标框架。

I've made sure that .Net 4.5 appears in Control Panel programs list and my C# solution sets .Net Framework 4 as the target framework.

有人能帮助我这一点?

推荐答案

见的的ZipFile类的MSDN上。它显示了所需的框架版本是4.5。一旦框架的版本是固定的检查已经添加了一个参考 System.IO.Com pression.FileSystem.dll 组件,并增加了使用 System.IO.Com pression 指令到你的类。

See ZipFile Class on MSDN. It shows the required framework version is 4.5. Once the framework version is fixed check you have added a reference to the System.IO.Compression.FileSystem.dll assembly and added a using System.IO.Compression directive to your class.