C# ArgumentException
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet runUnhandled exception. System.ArgumentException: Object must be of type String. at System.String.CompareTo(Object value) at Program.<Main>$(String[] args) in /home/kodingwindow/csharp/Program.cs:line 3 kodingwindow@kw:~/csharp$
C# program to handle the ArgumentException
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet run Something went wrong... kodingwindow@kw:~/csharp$
What Next?
C# program to handle the OutOfMemoryException
C# program to handle the TimeZoneNotFoundException
C# program to handle the PlatformNotSupportedException
Advertisement