1
votes

I am facing an error in Azure Portal Function Apps written in C# script.

error CS0103: The name 'ZipFile' does not exist in the current context

I try to use nuget.exe install System.IO.Compression.FileSystem.dll, but I cant add that package either. Error is as bellow.

D:\home\site\wwwroot Unable to find package 'System.IO.Compression.FileSystem.dll'

Please help me.

Thanks.

2
You need to add the reference via the standard AddReference menu option and searching for the dll. - NitinSingh

2 Answers

2
votes

Add the assembly and import namespace as below. It works on my side.

#r "System.IO.Compression.FileSystem"

using System.IO.Compression;
1
votes

Thanks for all answers. I had found the Answer. I had downloded the .dll file from Console, nuget.exe install 40-System.IO.Compression.FileSystem After downloading that , add the reference library

#r "..\40-System.IO.Compression.1.0.0.2\lib\net40-client\System.IO.Compression.dll"

#r "..\40-System.IO.Compression.FileSystem.1.0.0.2\lib\net40-client\System.IO.Compression.FileSystem.dll"

After that , Error gets removed.

Thanks to all.