Null Reference Exception when starting a process on a Windows Server robot

When I have a remote desktop session open, I am able to manually schedule a job and watch it execute. However, when I disconnect from the session, I get the following error:

Info : “Execution error : System.NullReferenceException: Object reference not set to an instance of an object.\r\n at UiPath.Core.Activities.InvokeWorkflowFile.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)\r\n at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)\r\n at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)”

Any ideas?

This has to do with the LoginToConsole setting. If it’s set to true, then there is no desktop and as such, no ability to perform mouse/keyboard commands or take screen shots.

“RobotKey”: “”,
“ResolutionHeight”: 0,
“LoginToConsole”: false,
“ResolutionWidth”: 0,
“OfflineBufferMB”: 64,
“LowLevelTracing”: “False”,
“RealtimeBufferCount”: “”,
“NuGetServerUrl”: “”,
“UiPathServerUrl”: “”,
“NuGetApiKey”: “”,
“TracingLevel”: “Information”,
“ResolutionDepth”: 0

So you need to run an automation without RDP connection? Check this Start from command line