ubuntuusers.de

C# Programm unter (K)ubuntu ausführen

Status: Ungelöst | Ubuntu-Version: Kubuntu 18.04 (Bionic Beaver)
Antworten |

Bertl1

Anmeldungsdatum:
13. April 2015

Beiträge: 80

Wohnort: Hauzenberg

Hallo,

habe ein kleines Spezialproagramm vorliegen, welches in C# unter Windows programmiert und compiliert worden ist. Habe bereits das Mono-Paket installiert. Klicke ich auf die .exe dann erscheint ca. ein halbe Sekunde das Programm und verschwindet dann wieder.

Wie könnte man sowas zum laufen bekommen? Kann mir da jemand helfen?

Marc_BlackJack_Rintsch Team-Icon

Ehemalige
Avatar von Marc_BlackJack_Rintsch

Anmeldungsdatum:
16. Juni 2006

Beiträge: 4696

Wohnort: Berlin

@Bertl1: Bekommst Du irgendwelche Ausgaben wenn Du das nicht per Mausklick sondern in einem Terminalfenster startest?

Bertl1

(Themenstarter)

Anmeldungsdatum:
13. April 2015

Beiträge: 80

Wohnort: Hauzenberg

Muss ich heute Abend mal probieren! Bis dahin bitte Geduld! 😉

Bertl1

(Themenstarter)

Anmeldungsdatum:
13. April 2015

Beiträge: 80

Wohnort: Hauzenberg

Hallo nochmal! Hier die Ausgabe nach Start mittels Konsole (mono WinTest.exe):

WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319

(mono:4183): Gtk-WARNING **: 10:25:14.375: Unable to locate theme engine in module_path: "adwaita",

(mono:4183): Gtk-WARNING **: 10:25:14.379: Unable to locate theme engine in module_path: "adwaita",

Unhandled Exception:
System.IO.FileNotFoundException: /home/gruber/FZ82/WinTest/magentacloud-WinTest(1)\OK.JPG
  at System.Drawing.Image.FromFile (System.String filename, System.Boolean useEmbeddedColorManagement) [0x0000b] in <1917aa1c39d94b1a91807b8cd9f03350>:0 
  at System.Drawing.Image.FromFile (System.String filename) [0x00000] in <1917aa1c39d94b1a91807b8cd9f03350>:0 
  at System.Windows.Forms.PictureBox.Load (System.String url) [0x0005e] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.PictureBox:Load (string)
  at WinTest.FormStart.ExecWind () [0x0016b] in <daa9311fd4a142b59ab6da403f92576e>:0 
  at WinTest.FormStart.ExecAll_Tick (System.Object sender, System.EventArgs e) [0x00167] in <daa9311fd4a142b59ab6da403f92576e>:0 
  at System.Windows.Forms.Timer.OnTick (System.EventArgs e) [0x0000b] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Timer.FireTick () [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Timer:FireTick ()
  at System.Windows.Forms.XplatUIX11.CheckTimers (System.Collections.ArrayList timers, System.DateTime now) [0x0009d] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue, System.Boolean allowIdle) [0x001bb] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue) [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUIX11.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, System.IntPtr handle, System.Int32 wFilterMin, System.Int32 wFilterMax) [0x00022] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, System.IntPtr hWnd, System.Int32 wFilterMin, System.Int32 wFilterMax) [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Application.RunLoop (System.Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x003e9] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00014] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00006] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at WinTest.Program.Main () [0x00010] in <daa9311fd4a142b59ab6da403f92576e>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: /home/gruber/FZ82/WinTest/magentacloud-WinTest(1)\OK.JPG
  at System.Drawing.Image.FromFile (System.String filename, System.Boolean useEmbeddedColorManagement) [0x0000b] in <1917aa1c39d94b1a91807b8cd9f03350>:0 
  at System.Drawing.Image.FromFile (System.String filename) [0x00000] in <1917aa1c39d94b1a91807b8cd9f03350>:0 
  at System.Windows.Forms.PictureBox.Load (System.String url) [0x0005e] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.PictureBox:Load (string)
  at WinTest.FormStart.ExecWind () [0x0016b] in <daa9311fd4a142b59ab6da403f92576e>:0 
  at WinTest.FormStart.ExecAll_Tick (System.Object sender, System.EventArgs e) [0x00167] in <daa9311fd4a142b59ab6da403f92576e>:0 
  at System.Windows.Forms.Timer.OnTick (System.EventArgs e) [0x0000b] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Timer.FireTick () [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Timer:FireTick ()
  at System.Windows.Forms.XplatUIX11.CheckTimers (System.Collections.ArrayList timers, System.DateTime now) [0x0009d] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue, System.Boolean allowIdle) [0x001bb] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue) [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUIX11.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, System.IntPtr handle, System.Int32 wFilterMin, System.Int32 wFilterMax) [0x00022] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, System.IntPtr hWnd, System.Int32 wFilterMin, System.Int32 wFilterMax) [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Application.RunLoop (System.Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x003e9] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00014] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00006] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at WinTest.Program.Main () [0x00010] in <daa9311fd4a142b59ab6da403f92576e>:0 

Vielleicht hilft das weiter! Die erste Zeile verrät ja eigentlich schon etwas, aber das hilft mir auch nicht weiter. ☹

Axel-Erfurt

Anmeldungsdatum:
18. Mai 2016

Beiträge: 1347

/home/gruber/FZ82/WinTest/magentacloud-WinTest(1)\OK.JPG

Der Pfad ist schon mal seltsam (FileNotFoundException / Datei nicht gefunden), vielleicht eher

'/home/gruber/FZ82/WinTest/magentacloud-WinTest(1)/OK.JPG'

Hast Du das Theme Adwaita in /usr/share/themes ?

Unable to locate theme engine in module_path: "adwaita",

Marc_BlackJack_Rintsch Team-Icon

Ehemalige
Avatar von Marc_BlackJack_Rintsch

Anmeldungsdatum:
16. Juni 2006

Beiträge: 4696

Wohnort: Berlin

@Bertl1: Gibt es die Datei unter /home/gruber/FZ82/WinTest/magentacloud-WinTest(1)/OK.JPG denn?

Bertl1

(Themenstarter)

Anmeldungsdatum:
13. April 2015

Beiträge: 80

Wohnort: Hauzenberg

Ja, die gibt es!

Angefügt habe ich euch den Inhalt des Ordners!

gruber@dell:~/FZ82/WinTest$ ls
GRÜN1.gif  GRÜN3.gif  GRÜN5.gif  GRÜN7.gif  NOK.jpg  ROT1.GIF  ROT3.GIF  ROT5.GIF  ROT7.GIF  Schanze1.bmp  WinTest.pdb
GRÜN2.gif  GRÜN4.gif  GRÜN6.gif  GRÜN8.gif  OK.jpg   ROT2.GIF  ROT4.GIF  ROT6.GIF  ROT8.GIF  WinTest.exe
Bilder

Axel-Erfurt

Anmeldungsdatum:
18. Mai 2016

Beiträge: 1347

jpg ist in Kleinbuchstaben, im Code aber nicht.

Bertl1

(Themenstarter)

Anmeldungsdatum:
13. April 2015

Beiträge: 80

Wohnort: Hauzenberg

Hast Du das Theme Adwaita in /usr/share/themes ?

Unable to locate theme engine in module_path: "adwaita",

Ups, nein, das habe ich nicht drin!

gruber@dell:/usr/share/themes$ ls
Breeze  Breeze-Dark  Default  Emacs  Raleigh

Was wäre denn da jetzt zu tun? Wie bekomme ich Adwaita da rein?

Bertl1

(Themenstarter)

Anmeldungsdatum:
13. April 2015

Beiträge: 80

Wohnort: Hauzenberg

Axel-Erfurt schrieb:

jpg ist in Kleinbuchstaben, im Code aber nicht.

Hab jetzt umbenannt in OK.JPG. Die Terminal-Ausgabe ist aber die selbe!

gruber@dell:~/FZ82/WinTest$ mono WinTest.exe
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319

(mono:2561): Gtk-WARNING **: 21:54:08.057: Unable to locate theme engine in module_path: "adwaita",

(mono:2561): Gtk-WARNING **: 21:54:08.060: Unable to locate theme engine in module_path: "adwaita",

Unhandled Exception:
System.IO.FileNotFoundException: /home/gruber/FZ82/WinTest\OK.JPG
  at System.Drawing.Image.FromFile (System.String filename, System.Boolean useEmbeddedColorManagement) [0x0000b] in <1917aa1c39d94b1a91807b8cd9f03350>:0 
  at System.Drawing.Image.FromFile (System.String filename) [0x00000] in <1917aa1c39d94b1a91807b8cd9f03350>:0 
  at System.Windows.Forms.PictureBox.Load (System.String url) [0x0005e] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.PictureBox:Load (string)
  at WinTest.FormStart.ExecWind () [0x0016b] in <daa9311fd4a142b59ab6da403f92576e>:0 
  at WinTest.FormStart.ExecAll_Tick (System.Object sender, System.EventArgs e) [0x00167] in <daa9311fd4a142b59ab6da403f92576e>:0 
  at System.Windows.Forms.Timer.OnTick (System.EventArgs e) [0x0000b] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Timer.FireTick () [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Timer:FireTick ()
  at System.Windows.Forms.XplatUIX11.CheckTimers (System.Collections.ArrayList timers, System.DateTime now) [0x0009d] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue, System.Boolean allowIdle) [0x001bb] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue) [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUIX11.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, System.IntPtr handle, System.Int32 wFilterMin, System.Int32 wFilterMax) [0x00022] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, System.IntPtr hWnd, System.Int32 wFilterMin, System.Int32 wFilterMax) [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Application.RunLoop (System.Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x003e9] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00014] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00006] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at WinTest.Program.Main () [0x00010] in <daa9311fd4a142b59ab6da403f92576e>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: /home/gruber/FZ82/WinTest\OK.JPG
  at System.Drawing.Image.FromFile (System.String filename, System.Boolean useEmbeddedColorManagement) [0x0000b] in <1917aa1c39d94b1a91807b8cd9f03350>:0 
  at System.Drawing.Image.FromFile (System.String filename) [0x00000] in <1917aa1c39d94b1a91807b8cd9f03350>:0 
  at System.Windows.Forms.PictureBox.Load (System.String url) [0x0005e] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.PictureBox:Load (string)
  at WinTest.FormStart.ExecWind () [0x0016b] in <daa9311fd4a142b59ab6da403f92576e>:0 
  at WinTest.FormStart.ExecAll_Tick (System.Object sender, System.EventArgs e) [0x00167] in <daa9311fd4a142b59ab6da403f92576e>:0 
  at System.Windows.Forms.Timer.OnTick (System.EventArgs e) [0x0000b] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0                                                                                                                 
  at System.Windows.Forms.Timer.FireTick () [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0                                                                                                                                 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Timer:FireTick ()                                                                                                                                              
  at System.Windows.Forms.XplatUIX11.CheckTimers (System.Collections.ArrayList timers, System.DateTime now) [0x0009d] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0                                                                 
  at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue, System.Boolean allowIdle) [0x001bb] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0                                                  
  at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue) [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0                                                                            
  at System.Windows.Forms.XplatUIX11.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, System.IntPtr handle, System.Int32 wFilterMin, System.Int32 wFilterMax) [0x00022] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0                                                                                                                                                                                                                           
  at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, System.IntPtr hWnd, System.Int32 wFilterMin, System.Int32 wFilterMax) [0x00000] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0  
  at System.Windows.Forms.Application.RunLoop (System.Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x003e9] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0                                                       
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00014] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0                                                                                 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00006] in <d5b72d15d4f7424c8a1538e3f19ec2e3>:0                                                                                              
  at WinTest.Program.Main () [0x00010] in <daa9311fd4a142b59ab6da403f92576e>:0                      

Axel-Erfurt

Anmeldungsdatum:
18. Mai 2016

Beiträge: 1347

Da ist immer noch ein backslash drin,

/home/gruber/FZ82/WinTest\OK.JPG

Bertl1

(Themenstarter)

Anmeldungsdatum:
13. April 2015

Beiträge: 80

Wohnort: Hauzenberg

Ja, das stimmt! Dumme Frage: Wie bekomme ich den Back-Slash raus?

Marc_BlackJack_Rintsch Team-Icon

Ehemalige
Avatar von Marc_BlackJack_Rintsch

Anmeldungsdatum:
16. Juni 2006

Beiträge: 4696

Wohnort: Berlin

@Bertl1: Der ist ja im Programm. Du könntest mal versuchen das OK.JPG ein Verzeichnis höher zu verschieben und in WinTest\OK.JPG umzubennennen. Also mv OK.JPG '../WinTest\OK.JPG' im /home/gruber/FZ82/WinTest/ ausführen. Wenn das Programm die Datei dann findet, könntest Du diesen Hack mit den anderen Dateien auch machen. ☺

Bertl1

(Themenstarter)

Anmeldungsdatum:
13. April 2015

Beiträge: 80

Wohnort: Hauzenberg

OK, ich checke das heute Abend mal ab.

Aber könnte es vielleicht auch folgendes sein? Programm wurde ja unter Windows geschrieben, und dort sind ja Verzeichnisse mit "\" getrennt. Wenn nun im Quellcode eben ein Verweis auf ein Windows-Verzeichnis vorkommt, dann funktioniert es unter Linux halt nicht!

Oder ist das "Käse" was ich da denke?!

PS: das Programm zum laufen zu bringen ist nur eine spielerei von mir. Für den echten Einsatz wird sowieso ein Windows Rechner verwendet. Von daher ist es gar nicht so wichtig es unter Linux zum laufen zu bringen. Nur zur Info: Das Programm erfasst den Wind an einer Skisprungschanze, wertet ihn anhand einstellbarer Grenzen aus und bestimmt somit die Freigabe für einen Springer.

rklm Team-Icon

Projektleitung

Anmeldungsdatum:
16. Oktober 2011

Beiträge: 13224

Bertl1 schrieb:

Programm wurde ja unter Windows geschrieben, und dort sind ja Verzeichnisse mit "\" getrennt. Wenn nun im Quellcode eben ein Verweis auf ein Windows-Verzeichnis vorkommt, dann funktioniert es unter Linux halt nicht!

Idealerweise gibt es eine plattformunabhängige Art und Weise, Pfade zusammen zu stecken. Wenn man die benutzt, sollte es überall gehen. In Java ist das zumindest so. Oft entwickeln Leute nur auf einer Plattform und bauen dann Pfade durch String-Verkettung. Dann hat man solche Probleme wie die, die Du beschreibst. ☺

Antworten |