Hello,
I have built a process that takes screenshots and it runs correctly on my environment and also from the Orchestrator.
When I try to run it from a VM in the Attended mode, it only works if I keep the VM open - if I close the VM or simply minimise it, it gives me an error:
System.ComponentModel.Win32Exception (6): 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.Vision.UiImage…ctor(Rectangle region, Int32 rotationDegree)
at UiPath.Core.Image…ctor(Region screenRegion)
at UiPath.Core.Activities.ObsoleteTaskAsyncCodeActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Could anyone please help me understand what is going wrong with the attended process?
Thank you in advance!