问题
I am running IIS7 on Windows 7 Pro. I have a VS2010 solution from which some projects are web services using IIS. Until recently all services worked correctly. However, whenever I add/configure/update a service reference or hit it directly via a web browser, I receive the following error:
There was an error downloading 'http://localhost/myapp.Web/myservice.svc'. The request failed with HTTP status 404: Not Found. Metadata contains a reference that cannot be resolved: 'http://localhost/myapp.Web/myservice.svc'. The remote server returned an unexpected response: (405) Method Not Allowed. The remote server returned an error: (405) Method Not Allowed. If the service is defined in the current solution, try building the solution and adding the service reference again.
Further investigation reveals that this is likely IIS disallowing POST verbs or some other configuration error with the same effect (GET requests work fine and there are other developers using the same code with no issues). Trying to load the wsdl returns a 404.3.
I have tried recreating the sites and applications in IIS, changing their settings in the application pools, reinstalling IIS, etc without success. Does anyone have some ideas on how to fix what is going on?
More info: I'm not sure if it's relevant or not, but I changed some settings in MSMQ around the same time when I was trying to resolve permission problems, but all have been reverted, MSMQ has been reinstalled, etc and the problem with IIS remains.
Thanks.
回答1:
I found the problem. Somehow my WCF and ASP.NET installations became corrupted. Reinstalling fixed the problem.
来源:https://stackoverflow.com/questions/6830888/iis-404-405-errors