Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Issue: Delay loading Json.NET type for JsonMediaTypeFormatter [149]

$
0
0
Currently Json.NET is always loaded even if the JSON formatter is removed from the formatter collection:

// Setup server configuration
var baseAddress = "http://localhost:8080/";
// Json.NET gets loaded here even though it is never used.
var config = new HttpSelfHostConfiguration(baseAddress);
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);

config.Formatters.Clear();
config.Formatters.Add(new XmlMediaTypeFormatter());

Comments: We don't think it is going to have much perf loss in loading the JSON.NET dll as they are relative small.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>