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

Created Issue: NRE from System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync [538]

$
0
0
In MVC Controller's action, write code:

HttpClient c = new HttpClient(GlobalConfiguration.DefaultHandler);
c.GetStringAsync("http://localhost/api/Values").Wait();

It will report NRE. I finally make it working with another code:

HttpClient c = new HttpClient(new HttpServer(GlobalConfiguration.DefaultHandler));
c.GetStringAsync("http://localhost/api/Values").Wait();

But it's better to throw meaningful exception in the first scenario if it's not allowed.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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