I can’t find the “is not” operator in C#.
For example I have the code below which does not work. I need to check that err is not of type class ThreadAbortException.
catch (Exception err)
{
if (err is not ThreadAbortException)
{
}
}
Just change the catch block to:
so you can handle ThreadAbortExceptions and all others separately.