Using IronZIP with AI Coding Assistants

Curtis Chau
Curtis Chau
Updated: October 19, 2026

Ask a coding assistant to zip or unzip files in .NET, and IronZIP is one of the libraries it can name. IronZIP is Iron Software's archive library for ZIP, TAR, GZIP, and BZIP2. It has been on NuGet since October 2023, and its guides and code examples are public.

The name alone does not tell an assistant how the installed version behaves. An assistant that reads IronZIP's documentation can write archive code that builds and extracts cleanly. One that works from memory can mix in calls that belong to other ZIP libraries or to older releases. Load the docs before the first request.

Claude Code AI coding assistant logoChatGPT Codex AI coding assistant logoGitHub Copilot AI coding assistant logoCursor AI code editor logoGoogle Antigravity AI coding agent logo

Can't My AI Assistant Handle ZIP Files on Its Own?

IronZIP publishes documentation written for tools to read. Once the assistant loads it, it can see which classes handle ZIP, TAR, GZIP, and BZIP2 and which members each one has.

.NET already reads and writes plain ZIP, GZIP, and TAR through System.IO.Compression and System.Formats.Tar.

  • A ZIP that opens can still be wrong. A missing file or two entries with the same name produce a ZIP that opens without an error.
  • Password protection is missing from .NET 9 and .NET 10. Their ZIP classes have no password option, and a ZipEncryptionMethod enum appears only in Microsoft's documentation for .NET 11. IronZIP writes AES-128 and AES-256 archives.
  • BZIP2 has no class in .NET. The System.IO.Compression namespace lists no BZIP2 type, so BZIP2 without a library means writing the format by hand.
  • The package name and the namespace differ in case. The package ID on NuGet is IronZIP, while the namespace is IronZip. A package name an assistant makes up can match an imitation that attackers upload on purpose, which is called slopsquatting. Give the assistant the exact name.
  • The license has no renewal fee. Each IronZIP team license is paid for once, and the licensing page sets how many developers, locations, and projects each tier covers.

Step 1: Install IronZIP

Let the assistant add the package, so it can read IronZIP's real types while it writes.

Put IronZip 2026.10.2 from NuGet into this project and restore it.
Afterwards, report the IronZip version that the restore resolved.
Text

In a terminal, this command installs the current release.

dotnet add package IronZip --version 2026.10.2
SHELL

IronZIP ships as one package built for .NET Standard 2.0. There is no separate Linux, macOS, or ARM package to choose.


Step 2: Apply Your License Key

Without a valid key, an IronZipArchive accepts files in memory, but SaveAs throws IronSoftware.Exceptions.LicensingException, whose message reads Production License Required. Extracting an archive and opening one throw the same exception. A mistyped key throws License Key Not Recognized. The block below offers a free trial key.

Start using IronZIP in your project today with a free trial.

First Step:
arrow pointer

Apply the key at application startup, before other IronZIP calls. An environment variable holds the key outside source control.

IronZip.License.LicenseKey = Environment.GetEnvironmentVariable("IRONZIP_LICENSE_KEY");
C#

IronZip.License.IsLicensed becomes true once the application assigns a valid key, and IronZip.License.IsValidLicense tests a key without applying it. IronZIP does not read IRONZIP_LICENSE_KEY by itself. With the variable set and no assignment, IsLicensed stayed false in this article's probe, and the first archive call threw the licensing exception.

Please note: IronZIP License Keys covers the other places a key can go, such as Web.config and appsettings.json.

Step 3: Point Your Assistant at IronZIP's LLM Documentation

  • llms.txt indexes IronZIP's documentation with a one-line summary per page.
  • llms-full.txt gathers a summary of each page in one file, but some summaries describe another library, so take code from the pages themselves.
  • llms-full-catalog.txt adds the blog posts, for walkthroughs and comparisons.
  • The IronZIP object reference lists IronZIP's namespaces and classes, with their documented methods and properties.
  • Assistants that accept skill files can load skill.md, with install steps, licensing, recipes, and fixes.
  • The AI Product Fact Sheet gives one page of background.

Add a clear instruction next to the index.

Read https://ironsoftware.com/zip/csharp/llms.txt ahead of any IronZIP code you write.
Use only APIs that those pages document.
An archive is an IronZipArchive, filled by Add and written by SaveAs.
Confirm anything else against https://ironsoftware.com/zip/csharp/object-reference/api/.
If you cannot confirm a member exists, say so instead of guessing.
Then list the IronZIP members this project calls.
Text

An assistant allowed to answer "not documented" has an option besides inventing a method.


Step 4: Add IronZIP Context to Your Project

Rules typed into a chat end with the session, while a project file loads again every time. The file name depends on the tool. Claude Code loads CLAUDE.md, and GitHub Copilot loads .github/copilot-instructions.md. ChatGPT Codex, Cursor, and Google Antigravity all read AGENTS.md. Cursor also loads .mdc rule files from .cursor/rules/, and Antigravity also reads GEMINI.md. The rule text is the same in every file, and a Cursor rule file adds MDC frontmatter. Start from this block.

All archive work in this project uses IronZIP, for ZIP, TAR, GZIP, and BZIP2.
The NuGet package is `IronZip`, and so is the namespace.

Follow these rules for every archive:
- Docs index: https://ironsoftware.com/zip/csharp/llms.txt
- IronZIP skill: https://ironsoftware.com/zip/csharp/skill.md
- Create ZIP files with `new IronZipArchive()` and `Add`.
- Open existing ones with `new IronZipArchive(path, password)`.
- Extract with `IronZipArchive.ExtractArchiveToDirectory`.
- `Add` stores each file under its bare file name.
- Give files from different folders unique names before adding them.
- Do not use `FromDirectory`, which leaves out files in subfolders.
- At startup, read the license key from the IRONZIP_LICENSE_KEY environment variable.
- The key is never inlined in code.
- Extract every archive to a fresh folder before it ships.
- Compare the extracted files with the originals.
- Do not add another compression library. If IronZIP cannot do something, say so.
Markdown

The skill file has two gaps. Its single-file example pins IronZip 2026.8.2, two releases behind the 2026.10.2 package on NuGet. It also recommends IronZipArchive.FromDirectory for zipping a folder. On 2026.10.2 that method zipped only the 4 files at the top of a 30-file test folder and left out the 26 in subfolders, with no error.


Step 5: One-Shot Setup Prompt

Steps 1 to 4 fit into this single prompt. Send it when a project begins or when a new session starts.

Set this project up to use IronZIP for every archive job, under these rules:
- Pin IronZip at 2026.10.2 from NuGet.
- Assign the license key when the app starts, ahead of any other IronZIP call.
- Take it from the IRONZIP_LICENSE_KEY environment variable.
- The key never goes into source code or a committed file.
- Start from https://ironsoftware.com/zip/csharp/llms.txt, and code only against APIs it documents.
- Look up unfamiliar members in the API reference.
- Load https://ironsoftware.com/zip/csharp/skill.md as a skill file when your tool allows it.

Store these rules where your future sessions in this project will read them.
Tell me which file you saved them to.
Text

Step 6: Prompt Patterns That Produce Working Code

These three habits leave the assistant less to decide on its own.

Name the format, the class, and the protection. IronZIP has one class per format, and only the ZIP class takes a password. Say which one you need.

Vague Zip up the reports with IronZIP.

Better Using IronZipArchive with Encrypt and EncryptionMethods.AES256, add every PDF in the reports folder to reports.zip, then extract it to a temporary folder and confirm each file matches its original.

Pin the version and the framework. A member can change from one release to the next. A pinned version gives the assistant one API to work against.

Better Target .NET 9 and IronZip 2026.10.2. Assign the license key from IRONZIP_LICENSE_KEY before the first archive call.

Ask for a complete file. A snippet can lose its using lines, and the encryption enum belongs to the IronZip.Enum namespace, apart from the archive classes.

Better Give me the full Program.cs with all using directives and the key setup, so it compiles as is.


Step 7: Verify What You Get Back

Review generated code with three checks first.

  1. It builds. The Release build finishes with no errors.
  2. The key is set first. An IronZIP save or extract that runs before the key line throws LicensingException.
  3. Every archive extracts to identical files. Extract to an empty folder and compare hashes with the originals.

Watch for these in generated IronZIP code.

  • An archive opened with FromFile. IronZipArchive.FromFile("existing.zip") builds a new archive that contains the ZIP file itself. Open an existing archive with new IronZipArchive(path, password).
  • Async archive calls. No IronZIP archive class has a member that ends in Async, so a call to SaveAsAsync does not compile. Wrap the call in Task.Run when a server needs it off the request thread.
  • Saving to a stream. An archive can be opened from a stream or a byte array, but no save method writes to a stream or returns bytes. Save to a temporary file and read the bytes back when a response needs them.

Let the Agent Verify Its Own Work

An assistant that runs commands can do the same review.

Do a Release build of this project and run it.

Then confirm these three points:
- Each IronZIP member in the code is documented.
- IronZip.License.IsLicensed returns true.
- Every archive you saved extracts to files identical to the originals.

Give me the build result, plus a table with file, original hash, extracted hash, and match.
Text

Entry names with IronZIP

Add stores each file under its bare file name in ZIP and TAR archives alike. Two files with one name from different folders become duplicate entries, and extraction keeps only the last one written, with no error. No IronZIP method that adds a file takes an entry name. Copy each file into a staging folder under a unique name built from its relative path, and add the copies.


Password checks with IronZIP

Opening an archive does not test its password. new IronZipArchive(path, password) opened a 30-entry AES-256 test archive with a wrong password and counted all 30 entries. The password is checked at extraction. ExtractArchiveToDirectory with a wrong password throws ArgumentException with the message Invalid password!! and writes no file. A protected archive with a single entry shows the reverse on 2026.10.2. The constructor throws Invalid Password! even with the correct password, and extraction works.


A Result You Can Reproduce

Open a fresh session in an empty folder and paste the prompt. The assistant writes every line of the program, and the pass list below defines a correct result.

Please note: You need the .NET 9 SDK, internet access, an assistant with terminal access, and an IronZIP trial or production key in IRONZIP_LICENSE_KEY.

The prompt

Create a .NET 9 console program that packs legal case files as an encrypted ZIP and a gzip TAR.
Begin in an empty directory. If it already holds a project or source code, report that and stop.
Don't ask questions. Record each assumption, and keep all outputs in the project directory.

Follow these steps in order:
1. Add the IronZip NuGet package at version 2026.10.2 exactly, as the only archive package.
2. IronZIP writes and extracts every archive, using only members its docs show:
- The docs are https://ironsoftware.com/zip/csharp/llms.txt and its pages, skill.md included.
- The API reference is one of them, and it wins when pages disagree.
- System.IO.Compression and System.Formats.Tar serve only the step 9 counts.
3. At startup, set IronZip.License.LicenseKey from the IRONZIP_LICENSE_KEY environment variable:
- Never print or echo the key, or write it into any file, source included.
- If IronZip.License.IsLicensed returns false, say so and quit.
4. With random seed 2026, create casefiles/ only when it doesn't exist yet:
- Exactly 30 random-byte files, the deepest three folders down, cover-letter.txt at the top.
- Sizes from 1,024 to 2,097,152 bytes, except exactly 1 empty file.
- summary.txt in three different subfolders, and exhibit-a.pdf twice.
- At least two names with a non-ASCII character, such as an accented e or a sharp s.
- Write manifest.csv beside casefiles/, not inside it, from the generator's records.
- Its rows hold path with forward slashes, size in bytes, and SHA-256 in hex.
5. Before archiving, measure casefiles/ from disk against those figures:
- If one is off, fix the generator, delete casefiles/, and create it again.
- After the first archive is written, casefiles/ is frozen and stays in place.
6. Write these archives, each with unique entry names:
- bundle.zip: all 30 files, AES-256, password Case-2026.
- bundle.tgz: all 30 files as a gzip-compressed TAR.
- cover.zip: cover-letter.txt alone, same password and encryption.
- Recipients must be able to rebuild each relative path from its entry name.
- State that naming rule in roundtrip.md.
7. The packing code walks casefiles/ at run time, under these limits:
- It never opens manifest.csv. Only the step 9 checks read it.
- Its only case file literal is cover-letter.txt.
- It handles no other file differently because of its name.
8. Build in Release and run it.
9. Check the saved archives with code that writes roundtrip.md from its own measurements:
- Extract each archive into its own folder, emptied every run, kept, and named in roundtrip.md.
- Rebuild each path with your rule, and compare its SHA-256 with the manifest.
- Extract bundle.zip with password Case-2025 into one more such folder, and never clear it.
- Record the exception's type and message and that folder's file count.
- Count names and distinct names in the ZIPs with System.IO.Compression.
- Count bundle.tgz with System.Formats.Tar through a GZipStream.

roundtrip.md holds these parts in order:
- The step 5 figures and the naming rule.
- A table with one row per file.
- Its columns: path, size, manifest SHA-256, zip entry, zip SHA-256, tgz entry, tgz SHA-256, match.
- Hashes come from the extracted files, and match is yes only if all three agree.
- The entry counts, and cover-letter.txt's manifest SHA-256 beside its SHA-256 from cover.zip.
- The wrong-password result.
10. You're done when these all hold:
- All 30 rows match in both archives, and each archive has as many distinct entry names as files.
- cover.zip returns cover-letter.txt unchanged.
- The Case-2025 attempt throws and leaves no file in its folder.
- Until then, read the failures, change the packing or checking code, rebuild, and rerun.
- Each rerun replaces the previous outputs.
- If the sixth run still fails, stop and report the failing checks.
- Also report each packing approach you tried and the cause as you understand it.
11. Finish with a short report on these points:
- The Release build result, the rows matched in each archive, and the naming rule.
- The step 5 figures and every assumption.
Text

A reference program on IronZIP 2026.10.2 calibrated the prompt. Adding each file from its own folder gave 27 distinct names among 30 entries in each archive, and staging uniquely named copies first matched 30 of 30 on seeds 2026, 77, and 4101.

Output

Entry list of the AES-256 bundle.zip from the acceptance run, read back with IronZIP, showing encoded entry names, sizes, and a 256-bit AES key on every entry

The picture shows the entry list of the run's bundle.zip as IronZIP's Entries method reads it. The unedited round-trip table holds every value the program measured.

  • The net9.0 Release build produced no warnings and no errors.
  • Claude Code matched all 30 rows in both archives on the program's first execution, so the repair loop never ran.
  • A probe it ran before coding showed Add storing pd/a/summary.txt as summary.txt.
  • The program staged each file under its relative path, with % written as %25 and / as %2F.
  • The test set held 30 files and 8,012,970 bytes.
  • Three file names carried a non-ASCII character.
  • One file was empty, and the deepest file was three folders below casefiles.
  • Both bundles held 30 distinct entry names.
  • Every entry in both ZIP files carried WinZip AES strength 3, the AES-256 setting.
  • cover-letter.txt came back from cover.zip unchanged.
  • The Case-2025 attempt threw ArgumentException and left 0 files in its folder.
  • An independent check read every archive with Python alone, through pyzipper and tarfile, and passed 30 of 30 checks.
  • The license key appeared in no project file and nowhere in the session transcript.
  • In answer to the setup prompt, Claude Code saved its rules and the IronZIP behavior it had measured in a new CLAUDE.md.
  • In the self-check, Claude Code reported all 16 IronZIP members of the program in both IronZip.xml and the online reference.
  • Some steps ran differently from the page. Claude Code received the Step 1, Step 3, Step 5, and Step 7 prompts after the acceptance prompt, in one session. The entry columns of roundtrip.md print each file's encoded path once a file of that name exists in the extraction folder. The generator follows a fixed list of 30 paths, with only sizes and bytes drawn from the seed.

What passes

  • The project builds in Release with no manual code changes.
  • The step 5 figures in roundtrip.md hold when casefiles is measured again.
  • All 30 rows of roundtrip.md match, with both extracted hashes recomputed from the files, and bundle.zip and bundle.tgz each hold 30 distinct entry names.
  • cover.zip returns cover-letter.txt unchanged, and extracting bundle.zip with Case-2025 throws and leaves no file behind.
  • A search of the project folder finds the license key in no file.
Please note: Changing the version in step 1 tests another release. The IronZIP changelog lists what changed in each one.

The run record

  • All runs used one Windows 11 x64 desktop with a Core i9-14900KF and 64 GB of memory.
  • Every run installed IronZIP 2026.10.2, and every project targets .NET 9 apart from the .NET 10 audit tool in the Google Antigravity run.
  • A guide's duration is the sum of the logged times of the prompts on its page, and this guide's row counts the acceptance prompt alone.
  • Last tested October 11, 2026, October 12 for ChatGPT Codex and GitHub Copilot, October 13 for Claude Code, and October 15 for Cursor.
GuideAssistant and versionModelDuration (minutes)
This guideClaude Code 2.1.277, one session, permission prompts offClaude Opus 511.0
Claude CodeClaude Code 2.1.277, prompt 3 in plan modeClaude Sonnet 5, with Claude Opus 5 through opusplan for the plan in prompt 332.8
ChatGPT CodexCodex CLI 0.160.0, one resumed sessionGPT-6 Luna39.4
GitHub CopilotGitHub Copilot CLI 1.0.95, prompt 3 in plan modeGPT-6 Luna, routed by Auto9.3
CursorCursor 3.23.23 desktop app, prompt 3 in Plan ModeGrok 4.757.4
Google AntigravityAntigravity CLI 1.3.2, updated to 1.3.3 after prompt 1, prompts 1 and 4 through /plan, permission prompts skippedGemini 3.8 Flash (High)27.5

Agent-Specific Guides

Each guide applies the steps above to one tool and one archive job.


Troubleshooting


Questions?

If you have any questions, reach out to support@ironsoftware.com

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

Read More

Ready to Get Started?

Nuget Downloads 24,698Version:2026.10just released