Applies to Product - Power Automate
What’s happening?
The customer is encountering a timeout error when invoking a C# code using the Run .NET script activity in Power Automate Desktop. The error message displayed is: "Action name: Run .NET script Error Message: The operation has timed out."
Reason:
The underlying cause of the timeout error may be related to the execution environment, such as screen resolution settings or the handling of UI elements during unattended execution. Some Windows machines or virtual machines may default to a smaller screen resolution when running unattended desktop flows, which can affect the automated applications if they are sensitive to screen resolution or if image-based automation is used.
Resolution:
- Check Screen Resolution Settings:
- Ensure that the default screen resolution is set correctly in the UIFlowService.exe.config file.
- Navigate to the installation directory of Power Automate Desktop and open the UIFlowService.exe.config file in a text editor.
- Set the Microsoft.Flow.RPA.UIFlowService.ScreenDefaultResolutionEnabled to true.
- Adjust the default screen resolution by setting the Width and Height parameters appropriately.
- Restart Power Automate Service:
- Go to the Start Menu, find the "Power Automate service" (in older versions, this may be called the "UIFlowService").
- Right-click on the service and select "Restart." Alternatively, you can reboot the machine.
- Collect Logs for Further Analysis:
- If this persists, collect the following logs for further investigation:
- Installer Logs: Located in the %temp% folder and %programdata%\Microsoft\Power_Automate_Desktop\Logs\Installer.
- Program Data Logs: Located in %programdata%\Microsoft\Power Automate\Logs.
- Event Viewer Logs: Open Windows Event Viewer, navigate to Windows Logs > Application, and review the error details.
