Why microsoft made JavaScriptSerializer obsolete prior to .net 3.5 SP1 and again active after that?

JavaScriptSerializer is not obsolete after .net 3.5 SP1. Should I uses JavaScriptSerializer or the prior recommended DataContractJsonSerializer?. Also why it was made obsolete?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I’d happily use JavaScriptSerializer – but if in doubt, consider a third option – Json.NET. Because it is 3rd party, it is unrelated to the MS decisions… that is a double-edged sword, of course – but it is often easier to get a minor fix applied to a standalone 3rd-party libary.

Method 2

I have not seen definitive explanation. There were quite a few people upset when JavaScriptSerializer was made obsolete.

Scott Gu made this comment on his blog saying that he thought marking it as obsolete didn’t make sense.

The JavaScriptSerializer is currently marked obsolete – although I’m not sure why (was going to ask someone about this today). It is very handy. Note that obsolete doesn’t mean removal in .NET 3.5 – it will be supported at least another version or two (or longer if I can convince them ).

I guess maybe he did convince them 🙂

I have continued to use JavaScriptSerializer as its much more straight forward than the DataContractJsonSerializer.

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x