2021
In 2021 the JavaScriptSerializer
is not only deprecated it has been removed in .Net Core and .Net 5.x. So you can't use this anymore unless your targeting the .Net Framework 4.8 or below.
The replacement is the System.Text.Json
suite of classes.
Is it deprecated
No. Otherwise, they would have marked it obsolete.
should this class not be used in general
Providing your targetting .Net Framework 4.8 or below then sure you can use it, if you want to taregt .Net core or .Net 5 then you can't as it's not available anymore.
This is here as a comparision between the available .Net Framework classes. I actually go into more detail on System.Text.Json vs Json.Net in another answer.
Now is it the best serialiser to use? Basically no and even Microsoft know this and use Json.Net internally for things such as the Web.API. Hence the recommendation. It has several advantages over the JavaScriptSerializer. It seems the new Microsoft is attempting to embrace the open source community (hopefully not to extinguish it...) and utilise the wealth of tools out there.
It seems Microsoft can't make up their minds about making it actually obsolete. My guess is they still maintain it because it's used internally and re-writing stuff to use Json.Net is just more work than it's worth.
Tl;Dr
Use Json.Net if your targetting .Net Framework 4.8 or below, for .Net core or .Net 5 then you can choose between Json.Net or System.Text.Json.