When I tested “Take Screenshot” activity locally it worked fine, but when I tried to run it in background on a vm, I got the following exception:
Take Screenshot: System.ComponentModel.Win32Exception (0x80004005): The handle is invalid at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation) at System.Drawing.Graphics.CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize, CopyPixelOperation copyPixelOperation) at UiPath.Vision.UiImage.FromScreenRegion(Rectangle region) at UiPath.Core.Image…ctor(Region screenRegion)
I tried changing hight, width, depth from orchestrator, but it didn’t solve the problem. Is this problem caused by new updates because I’ve seen some solutions saying that for this type of exception I should uninstall and install everything again.
Studio Pro 2020.10.2 Community License
Orchestrator 2020 Community License
User Mode Robot (I’ve checked the service, screenshot below with what I can see on our VM)
Unattended robot (resolutions set + login to console - set to no)
Error getting only when running from Orchestrator (for Take Screenshot activity - the one from this post)
Can you, please confirm that the only solution for us to make it work is to acquire the EE and use the MSI installer? (maybe to opt for the trial version meanwhile?)
As stated in the post, this is what we get:
Take Screenshot: System.ComponentModel.Win32Exception (0x80004005): The handle is invalid at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation) at System.Drawing.Graphics.CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize, CopyPixelOperation copyPixelOperation) at UiPath.Vision.UiImage.FromScreenRegion(Rectangle region) at UiPath.Core.Image…ctor(Region screenRegion)
But only if we try to run from Orchestrator and simulate an error to be caught by the Global Handler (where the Take Screenshot activity is located) we receive it.
What I See about this issue is PC is “locked” and robot cannot access to Desktop. If you are using Teamviewer, AnyDesk or Similar, make sure PC is not locked (Windows + L)