.NET Web API 2和IIS PUT/DELETE不工作

.NET Web API 2和IIS PUT/DELETE不工作,.net,iis,asp.net-web-api,.net,Iis,Asp.net Web Api,在删除对我的Web API 2控制器的请求时,我得到: Request URL:http://localhost/phoenix/api/apps/1245 Request Method:DELETE Status Code:404 Not Found DELETE http://localhost/myapp/api/apps/1245 404 (Not Found) 我的控制器看起来像: [EnableCors(origins: "http://localhost", hea

在删除对我的Web API 2控制器的请求时,我得到:

Request URL:http://localhost/phoenix/api/apps/1245 
Request Method:DELETE
Status Code:404 Not Found

DELETE http://localhost/myapp/api/apps/1245 404 (Not Found) 
我的控制器看起来像:

    [EnableCors(origins: "http://localhost", headers: "*", methods: "*", SupportsCredentials = true)]
[Route("api/apps")]
public class ApplicationController : ApiController
{
    // DELETE api/apps/5
    public void Delete(string id)
    {
        //apps.Delete(id);
    }
}
“我的IIS”是为放置/删除谓词设置的:

my web.config中有*个动词:

<system.webServer>
  <handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
  </handlers>
</system.webServer>


我缺少什么?

路由模板中不存在
id
参数。将控制器级路由更改为
[路由(“api/apps/{id?}”)]
或者从querystring提供id值