0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

現在のコンテキストに '○○' という名前は存在しません

Posted at

エラーが出る

「C#コードレシピ集」の「Chapter 18 Zipファイル 276」を試していたところ、エラーが出た。

error CS0103: 現在のコンテキストに 'ZipFile' という名前は存在しません
using System;
using System.IO;
using System.IO.Compression;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            var src = "./source/example";
            var dst = "./archives/myarchive.zip";

            ZipFile.CreateFromDirectory(src, dst);
        }
    }
}

対処法

  1. プロジェクト→参照の追加
    image.png

  2. 必要なアセンブリを選択する
    image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?