Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is Request.CreateErrorResponse?

I saw it in this blog post, but that doesn't actually say how to "enable" it. And it seems that by default it isn't enabled.

I know it's an extension method, as defined here: http://msdn.microsoft.com/en-us/library/hh835786(v=vs.108).aspx but how do I get access to it? If I type Request.CreateErrorResponse then the compiler doesn't recognize it.

I'm already using System.Net.Http.

like image 939
Gary McGill Avatar asked Sep 23 '12 20:09

Gary McGill


Video Answer


2 Answers

I've noticed this in release version as well. And if you don't have the right using statement, it'll error. You need :

using System.Net.Http; 

even if you already have this:

using System.Web.Http.Controllers; 
like image 125
KeithR Avatar answered Sep 19 '22 18:09

KeithR


Are you still using pre-release or release version? There were a number of extensions that did not appear until just before the release and did not exist in earlier versions of the webapi release. I am unsure if this was one of them, but it may be what is causing your problem.

like image 43
AlexGad Avatar answered Sep 21 '22 18:09

AlexGad