From 13061704c36646634f300914827e1d1a7ea651db Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 18 Mar 2025 20:24:23 +0800 Subject: [PATCH] Add instructions to fix 405 Method Not Allowed error in IIS deployment --- .../deployment/deployment-iis.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/en/solution-templates/layered-web-application/deployment/deployment-iis.md b/docs/en/solution-templates/layered-web-application/deployment/deployment-iis.md index 79382f1b0a..3d33cbd7a1 100644 --- a/docs/en/solution-templates/layered-web-application/deployment/deployment-iis.md +++ b/docs/en/solution-templates/layered-web-application/deployment/deployment-iis.md @@ -254,6 +254,35 @@ We can visit the websites from a browser. ![Tiered IIS deployment](../../../images/iis-sample-tiered-deployment.gif) +## Fix 405 Method Not Allowed Error + +Remove `WebDAV` modules and handlers from the `Web.config` file. + +```xml + + + + + + + + + + + +``` + +Also remove the `WebDAV Publishing` feature from your computer if it's not being used. To do so, follow these steps: + +1. Select Start, type Turn Windows features on or off in the Start Search box, and then select Turn Windows features on or off. +2. In the Windows Features window, expand Internet Information Services -> World Wide Web Services -> Common HTTP Features. +3. Uncheck the WebDAV Publishing feature. + +See: + +- https://learn.microsoft.com/en-us/aspnet/web-api/overview/testing-and-debugging/troubleshooting-http-405-errors-after-publishing-web-api-applications#resolve-http-405-errors +- https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/site-behavior-performance/http-error-405-website#resolution-for-cause-3 + ## How to get stdout-log If your application is running on IIS and getting errors like `502.5, 500.3x`, you can enable stdout logs to see the error details.