Invoke Method not recognizing ExtractToFile method

I am trying to use the Invoke Method in UiPath and am getting an error. Here is how I have my invoke method set up:

TargetType: null
TargetObject: entry
MethodName: ExtractToFile

entry has a type of: System.IO.Compression.ZipArchiveEntry

I have installed the necessary packages: System.IO.Compression and System.IO.Compression.ZipFile

I have 2 parameters set up for the invoke method:
Direction - In, Type - String, Value - full path
Direction - In, Type - Boolean, Value - True

I am getting the following error:
ZipArchiveEntry does not have a public instance method named ExtractToFile matching the parameter types, generic type arguments and generic type constraints supplied to InvokeMethod ‘invokeMethod’

I am trying to stay away from using the invoke vb code activity and am trying to accomplish this by using the invoke method activity instead. Any assistance is greatly appreciated

Hi @j1osu2006
Are you trying to Zip/Unzip? If so, use the following activities

I am actually reading the zip file first I order to determine the character length of the folders/file names first before I extract them. If I use those activities above it will throw exceptions as the naming convention of those files are longer then 260

@j1osu2006

this is how you need to use

Hope this helps

cheers

Oh my gosh I tried all other System.IO.Compression…. except for the ZipFileExtensions :rofl:. Works like a charm. Really appreciate your assistance.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.