我正在尝试按照这个视频教程(大约在1分钟处)中描述的方法引发HttpResponseException
throw new HttpResponseException(HttpStatusCode.Unauthorized);
但是该应用程序无法编译,因为它会抛出以下错误:
The best overloaded method match for 'System.Web.Http.HttpResponseException.HttpResponseException(System.Net.Http.HttpResponseMessage)' has some invalid arguments
在MSDN文档中,它有一个接受HttpResponseMessage
枚举的构造函数。http://msdn.microsoft.com/en-us/library/hh835324%28v=vs.108%29.aspx
我错过了什么?
谢谢