Uruchomiłem ten sam pogram na systemie: windowsie oraz linux. Mój problem polega na tym, że linux nie pokazuje całego stack trace. Nie wiadomo w której linii pojawił się wyjątek. Czy wiecie może jak to naprawić? Kod umieszczam poniżej.
Wynik z linuxa:
Exception from method ThrCommunication.ScanSystem8
Exception method ThrCommunication.ScanSystem8 message : Object reference not set to an instance of an object
Stack Trace : at ConsoleApp2.Tes.tets () [0x00000] in <filename unknown>:0
at ConsoleApp2.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
Inner exception :
Exception from method ThrCommunication.ScanSystem8 end.
System.NullReferenceException: Object reference not set to an instance of an object
at ConsoleApp2.Tes.tets () [0x00000] in <filename unknown>:0
at ConsoleApp2.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
Wynik z windowsa:
Exception from method ThrCommunication.ScanSystem8
Exception method ThrCommunication.ScanSystem8 message : Odwołanie do obiektu nie zostało ustawione na wystąpienie obiektu.
Stack Trace : w ConsoleApp2.Tes.tets() w C:\Users\OEM\Desktop\ConsoleApp2\Tes.cs:wiersz 15
w ConsoleApp2.Program.Main(String[] args) w C:\Users\OEM\Desktop\ConsoleApp2\Program.cs:wiersz 23
Inner exception :
Exception from method ThrCommunication.ScanSystem8 end.
System.NullReferenceException: Odwołanie do obiektu nie zostało ustawione na wystąpienie obiektu.
w ConsoleApp2.Tes.tets() w C:\Users\OEM\Desktop\ConsoleApp2\Tes.cs:wiersz 15
w ConsoleApp2.Program.Main(String[] args) w C:\Users\OEM\Desktop\ConsoleApp2\Program.cs:wiersz 23
Method Main line 31