【发布时间】:2013-05-29 07:26:14
【问题描述】:
在尝试将 JSON 数据从脚本端传递到 WebAPI 服务内部的方法时,我们遇到了以下异常。
{
"Message":"No HTTP resource was found that matches the request URI '.../api/Values/Sample'.",
"MessageDetail":"No type was found that matches the controller named 'Values'."
}
重要提示:
在 .net 4.0 和 VS2010 中使用 WebAPI 时,我们没有遇到任何此类问题,但是当我们在 .net 4.5 和 VS2012 中使用 WebAPI 时,我们看到了这个问题。因此,请使用 4.5 框架对此进行诊断。 我们在以下链接中附加了示例。如果您可以使用 cmets 查看并发布正确的示例,那将非常有帮助,因为我们是 WebAPI 概念的新手。带有适当 cmets 的事件发布代码 sn-p 就可以了。
示例链接:http://www.fileconvoy.com/dfl.php?id=gb197faeca5017d489993001280c7f122f64fc06a7
提前致谢。
【问题讨论】:
标签: asp.net-web-api asp.net-web-api-routing