无法将 .svc 文件放入 IIS 托管的 WebDAV 目录 - 日志显示 HTTP 错误 405
我正在尝试通过比 FTP 选项更可靠的方式进行发布,该选项在 Visual Studio 中工作时断时续,而且速度非常慢。那么我先问你:2011年,使用Visual Studio进行发布,WebDAV是最好的选择吗?
无论如何,我已经启动并运行了由 IIS 7 托管的 WebDAV,并且我已成功将其映射为驱动器。我也可以在那里复制文件,但文件扩展名为 .svc 的文件除外。我可以发布我尝试过的所有其他内容,如果我首先将其重命名为其他内容,然后在它已经位于 WebDAV 目录中后重命名回来,也可以发布 .svc 文件。
这是 IIS 日志:
2011-03-19 18:32:54 192.168.0.9 PROPFIND /bin/service.svc - 80 SERVER\User my.ip.not.shown Microsoft-WebDAV-MiniRedir/6.1.7600 405 0 0 0
如您所见,它以 405 结尾。
我在 google 上搜索到的唯一类似的事情可以通过配置 applicationHost 文件的 、 和 部分来解决。合乎逻辑的事情是检查 中的条目,但它没有提及 .svc。我还尝试将 applyToWebDAV 设置为 false。
有什么想法吗?
更新:
思考一下,是否可能只是 WCF http 处理程序拦截了 url,因为 .svc 已在该处理程序中注册?
I am trying to publish via something more reliable than the FTP option, which works very intermittently from visual studio - and is very slow. So let me first ask you: In 2011, using visual studio to publish, is WebDAV the best option?
Anyway, I've got WebDAV hosted by IIS 7 up and running, and I have managed to map it as a drive. I can copy files there aswell, except anything with the file extension .svc. I can publish everything else I've tried, and also publish the .svc file if I first rename it to something else, then renaming back after it already is in the WebDAV directory.
Here is the IIS log:
2011-03-19 18:32:54 192.168.0.9 PROPFIND /bin/service.svc - 80 SERVER\User my.ip.not.shown Microsoft-WebDAV-MiniRedir/6.1.7600 405 0 0 0
As you can see, it ends in 405.
The only similar thing I've managed to google up could be solved by configuring the , and sections of the applicationHost file. The logical thing would be to check for an entry in , but it says nothing about .svc. I've also tried setting applyToWebDAV to false.
Any ideas?
UPDATE:
Thinking on it, could it simply be that the WCF http handler intercepts the url, since .svc is registered with that handler?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我想通了。在处理程序映射中,WCF 处理程序排在 WebDAV 处理程序之前,因此它拦截了对 *.svc 的请求。它又返回 405 method not allowed for PROPFIND。
只需在列表中向上移动 WebDAV 条目,直到它在映射中适当地早期列出即可。
Alright, I figured it out. The WCF handler was ordered before the WebDAV handler in the handler mappings, so it intercepted requests to *.svc. It in turn returned 405 method not allowed for PROPFIND.
Simply move the WebDAV entry upwards in the list until it is listed appropriately early in the mappings.