title: Cannot find `ZipArchive` in the “System.IO.Compression” namespace
body: <p>My question is related to <a href="https://stackoverflow.com/questions/15241889/i-didnt-find-zipfile-class-in-the-system-io-compression-namespace">I didn&#39;t find &quot;ZipFile&quot; class in the &quot;System.IO.Compression&quot; namespace</a> </p>
  
  <p><a href="https://i.stack.imgur.com/6Pi4e.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6Pi4e.png" alt="The type or namespace name &#39;ZipArchive&#39; does not exist in the namespace &#39;System.IO.Compression&#39;"></a></p>
  
  <p>But I have referenced the DLL's for my 4.5.1 webforms project:</p>
  
  <p><a href="https://i.stack.imgur.com/YSafj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/YSafj.png" alt="Screenshot of &#39;References&#39; tab"></a></p>
  
  <p>Properties of my project give me: <code>Target framework: .Net Framework 4.5.1.</code>
  and the web.config: </p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;compilation debug="true" targetFramework="4.5" /&gt;
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>The solution was to manually reference the assemblies in the web.config But why? Why wasn't the checkbox in the add reference dialog insufficient?</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;assemblies&gt;
      &lt;add assembly="System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt;
      &lt;add assembly="System.IO.Compression.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt;
  &lt;/assemblies&gt;
  </code></pre>
  
  <p>Taken from <a href="https://stackoverflow.com/a/20099950/169714">this answer</a> to "Installed .Net 4.5 but can't use ZipFile class in Visual C#"</p>