.NET Exception

Hii

 Whenever iam trying to run my main frame application  through UIpath . The approximate time 
 is 10 min for the robo to complete the application.Sometimes The robo will run Completely and  
sometimes it is failing at a particular main frame screen showing the .Net exception.I am attaching 
 the screenshot.Can someone please help me with this.

Is the mainframe hosted on remote server or the desktop where UIStudio is installed Also this error is coming when you are attaching the window?

Yes The mainframe application and Uipath is installed in one machine only not on remote server.