简体   繁体   中英

IIS Express won't serve up ASMX web services

For some unknown reason, IIS Express is refusing to serve up ASMX web services. Instead, I get the following error:

HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.

I'm running a site using ASP.NET 2.0 on the Classic app pool (it's an old existing site, with third party DLLs that don't play well with the Integrated app pool). I don't think it matters any, but the site is also set to allow an HTTPS binding via the "SSL Enabled" setting in Visual Studio. I've verified the framework installations are correct via aspnet_regiis without any change.

It turns out that since the site was also making use of the older Ajax Extensions, there was a modification to the web.config file that was breaking the default handlers within IIS Express:

<handlers>
    <remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>

I got rid of the "remove" line, and that solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM