How do I use JavaScriptSerializer in ASP.NET 5?
Asked Answered
G

1

3

I am porting my project to DNX-Core 5.0 and trying to get work but I cannot find the JavaScriptSerializer and AppSettingReader classes. I know the System.Web is removed and so please anyone help me to find the alternative of using them.

Is there any Nuget available to include them?

Georgettegeorgi answered 14/5, 2015 at 14:16 Comment(0)
U
7

The ASP.Net 5 team dropped the JavaScriptSerializer in favor of the widely used Newtonsoft.Json package, but they did provide a JsonOutputFormatter and a JsonInputFormatter for use with MVC to be able to return objects more directly.

For the AppSettingReader you'll want to look at the new ASP.Net 5 Configuration Model. This has been detailed in a few blog posts while it's being built. These posts only detail how to load out individual fields, but the tests in the Options Model show that you can bind directly to an object.

Unconventionality answered 15/5, 2015 at 12:58 Comment(1)
Plus one for using Options instead of ConfigurationOuzo

© 2022 - 2024 — McMap. All rights reserved.