的ASP.NET Web API只在某些服务器上PUT返回404 [英] ASP.NET Web API returns 404 for PUT only on some servers

查看:623
本文介绍了的ASP.NET Web API只在某些服务器上PUT返回404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(从服务器故障后交。我后来意识到,也许我应该问的第一个计算器)

(cross post from Server Fault. I realised afterwards that I probably should have asked on stackoverflow first)

好吧,我一直在货架我的大脑和互联网为解决这一点。我只是不明白。

Ok, I have been racking my brain and the internet for a solution to this. I just can't figure it out.

我写一个使用ASP.NET MVC的Web API和所有工作很好,直到我把它放在临时服务器的站点。该网站工作正常,我的本地计算机和开发Web服务器上。无论开发和分期服务器都赢Server 2008 R2中。

I have written a site that uses ASP.NET MVC Web API and all working nicely until I put it on staging server. The site works fine on my local machine and the dev web server. Both dev and staging servers are Win Server 2008 R2.

问题是这样的:基本上是网站的作品,但也有使用HTTP PUT方法的一些API调用。这些失败的分期返回404,但做工精细别处。

The problem is this: basically the site works, but there are some API calls that use the HTTP PUT method. These fail on staging returning a 404, but work fine elsewhere.

这是我碰到的和固定的第一个问题是请求筛选。但仍然得到404。

The first problem that I came across and fixed was in Request Filtering. But still getting the 404.

我已经把在IIS跟踪,并得到以下问题。

I have turned on tracing in IIS and get the following problem.

168. -MODULE_SET_RESPONSE_ERROR_STATUS 
ModuleName IIS Web Core 
Notification 16 
HttpStatus 404 
HttpReason Not Found 
HttpSubStatus 0 
ErrorCode 2147942402 
ConfigExceptionInfo  
Notification MAP_REQUEST_HANDLER 
ErrorCode The system cannot find the file specified. (0x80070002) 

该CONFIGS都在开发和分期,其实事情一样,整个网站是一个直接的副本。

The configs are the same on dev and staging, matter of fact the whole site is a direct copy.

为什么会产生GET和POST工作,但不是看跌期权?

Why would the GETs and POSTs work, but not the PUTs?

感谢

格雷格

推荐答案

这些IIS服务器安装在他们网络的DAV模块,我敢打赌不需要,它是安装,因为安装人员打勾所有箱子吧。

Those IIS servers have web-dav module installed on them and i bet it is not needed and it was installed because the person installing ticked all boxes.

刚刚从IIS中删除Web-DAV。

Just remove web-dav from iis.

或者使用web.config中删除Web DAV模块:

Alternatively use web.config to remove web dav module:

<system.webServer>
    <modules>
        <remove name="WebDAVModule" />
    </modules>
    ...

这篇关于的ASP.NET Web API只在某些服务器上PUT返回404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆