Add-Type: Cannot add type. The assembly ‘System.IO.Compression.FileSystem’ could not be found

Question:

I am using simple PowerShell script in TeamCity Builds.

It requires System.IO.Compression.FileSystem and the agent has .NET 4.5.2 installed. Below are the .NET frameworks installed

The PowerShell script has following line

On the second line, the execution fails with error

Strange, but I expected that with .NET 4.5.2, PowerShell should be able to load assembly from GAC

Any help will be appreciated

Answer:

Try to load particular DLL instead:

Source:

Add-Type: Cannot add type. The assembly ‘System.IO.Compression.FileSystem’ could not be found by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply