I use in my project Sharpcompress library to extract files from RAR.
The process was okay until recently, I suspect the update to 2019.10 version caused this.
I use Invoice Code to extract files:
and it fails with following error: Invoke Code: Method ‘UiPathCodeRunner_bd84b7993e7d4c0a96e9ac23305e77c7.Run’ not found.
When loading the project in Studio I am getting following warning: NU3034: Package ‘SharpCompress 0.22.0’ from source ‘https://www.nuget.org/api/v2’: This package is signed but not by a trusted signer.
I tried to reinstall the Sharpcompress package and now I have the package in error
After package reinstall I could run this process from Studio but when I attempt to run it unattended it fails with same error.
I tried to revert to 2019.9.2 but the problem persists.
I tried change the code as follows - using generic Object type and cast it to RarArchiveEntry
And I got following error:
RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> RemoteException wrapping System.InvalidCastException: [A]SharpCompress.Archives.Rar.RarArchiveEntry cannot be cast to [B]SharpCompress.Archives.Rar.RarArchiveEntry. Type A originates from ‘SharpCompress, Version=0.22.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96’ in the context ‘LoadFrom’ at location ‘C:\Users\svc_rpa01.nuget\packages\sharpcompress\0.22.0\lib\net45\SharpCompress.dll’. Type B originates from ‘SharpCompress, Version=0.22.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96’ in the context ‘Default’ at location ‘c:\ProgramData\svc_rpa01\UiPath\app-19.8.0\SharpCompress.dll’.
at UiPathCodeRunner_3c908eeedd454b93a7063182f647cb59.Run(Object item, String strOutputFolder)
This implies that there is conflict between two instances of SharpCompress.dll
Could you make sure that your Robot service is running on the latest 2019.10 version?
It looks like it is trying to fetch the file from the directory of the previous version: c:\ProgramData\svc_rpa01\UiPath\app-19.8.0\SharpCompress.dll
Are you by chance using Studio CE with Robot service converted to machine wide service?
If so, it did not auto-update on your unattended machine which is what is most likely causing the issue.
It is a wild guess though, as that trick is not documented (but I think I recall you trying to do it some time ago )
My suggestion here would be to first make sure all services and both Studio/Robot run with the latest 2019.10 stable version.
Well, the robot is running 19.8 CE both Studio and UiPath.Service.Host. Still there is this error.
On my workstation I have 19.10 CE - it auto updated and I did not realized it is updated as there is no notification about update . Seems the problem started once I deployed to robot updated process (updated in 19.10 CE). Strange thing is that after restoring to previous version the problems still persists.
On my workstation (v19.10 CE) process works okay when launched from Studio but fails with same error when launched from Agent
The only way to get rid of this problem is remove SharpCompress from Dependencies but keep it in Imports.
I would expect that process and robot should not interfere and use own set of libraries, right?
I think for the first scenario (running 19.10 process on 19.8) it is expected to not work (you can’t rely on an older robot to run process created in new versions).
The other thing, that the process works from Studio but not from the Agent. This might be due to the package files being a bit corrupted.
Could you try clearing these locations to let Studio / Robot to re-download the packages again?
%userprofile%\.nuget\packages\
%userprofile%\AppData\Local\UiPath
and any from C:\ProgramData\UiPath\
Of course feel free to make backups first
Lastly:
as there is no notification about update
It is something we will try to improve in the future