Você não tem um servidor X em execução. Sem um servidor X, não há Display para o aplicativo ao qual se ligar.
Estou tentando executar um aplicativo mono WinForm a partir da linha de comando sem um ambiente de área de trabalho completo. Ele é aberto corretamente por meio de SSH (usando o SmarTTY e o encaminhamento X). No entanto, quando eu tento executá-lo diretamente no PI eu recebo isso.
A essência disso é "Não foi possível abrir a tela (é necessário o X-Server. Verifique sua variável DISPLAY)"
Unhandled Exception: System.InvalidOperationException: WinForms_SeeInnerException ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable) Parameter name: Display at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in :0 at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in :0 at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in :0 at System.Windows.Forms.XplatUI..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Theme.get_MenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.Control..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor () at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Control..ctor () [0x00000] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x00000] in :0 at System.Windows.Forms.Form..ctor () [0x00000] in :0
at MfgControl.AdvancedHMI.MainForm..ctor () [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in :0 --- End of inner exception stack trace --- at MfgControl.AdvancedHMI.My.MyProject+MyForms.Create__Instance__[MainForm] (MfgControl.AdvancedHMI.MainForm Instance) [0x00000] in :0 at MfgControl.AdvancedHMI.My.MyProject+MyForms.get_MainForm () [0x00000] in :0 at MfgControl.AdvancedHMI.My.MyApplication.OnCreateMainForm () [0x00000] in :0 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () [0x00000] in :0 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (System.String[] commandLine) [0x00000] in :0 at MfgControl.AdvancedHMI.My.MyApplication.Main (System.String[] Args) [0x00000] in :0 [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: WinForms_SeeInnerException ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable) Parameter name: Display at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in :0 at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in :0 at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in :0 at System.Windows.Forms.XplatUI..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Theme.get_MenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.Control..ctor () [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor () at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Control..ctor () [0x00000] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x00000] in :0 at System.Windows.Forms.Form..ctor () [0x00000] in :0
at MfgControl.AdvancedHMI.MainForm..ctor () [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in :0 --- End of inner exception stack trace --- at MfgControl.AdvancedHMI.My.MyProject+MyForms.Create__Instance__[MainForm] (MfgControl.AdvancedHMI.MainForm Instance) [0x00000] in :0 at MfgControl.AdvancedHMI.My.MyProject+MyForms.get_MainForm () [0x00000] in :0 at MfgControl.AdvancedHMI.My.MyApplication.OnCreateMainForm () [0x00000] in :0 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () [0x00000] in :0 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (System.String[] commandLine) [0x00000] in :0 at MfgControl.AdvancedHMI.My.MyApplication.Main (System.String[] Args) [0x00000] in :0