开发者

Configure IIS 7.0 to enable webservices in classic mode

What are the configuration file settings to enable webservices on IIS 7.0 in classic mode? The site has to be in a classic mode application pool because the Report Viewer controls crash when running in Integrated Mode. However in a classic mode application pool, webservices produce the following error message:

The requested content appears to be script and will not be served by the static file handler.

•If you want to serve this content as a static开发者_开发问答 file, add an explicit MIME map

EDIT - Additional Error Message Info:

  1. HTTP Error 404.17 - Not Found
  2. Module: StaticFileModule
  3. Notification: ExecuteRequestHandler
  4. Handler: StaticFile
  5. Error Code: 0x80070032

Note: This particular instance of the application will be running in a customers account on a shared hosting enviroment so access to IIS UI is not/will not be available. Specifically seeking configuration file adjustments.


In IIS Manager (Start -> Run -> inetmgr), select the website or virtual directory you want to set to classic mode.

In the right hand panel "Actions", click on "Basic Settings".

Next to application pool (that is defaulted to DefaultAppPool), click "Select" and change it to "Classic .Net AppPool".

Walkthrough is here.

Update: Sorry, I misread your question. There are a couple of things you can try:

The first is to double check the IIS installation features from the control panel (Programs and Features -> Turn Windows Features on and off -> Internet Information Services -> World Wide Web Services -> Application Development Features). I have everything bar CGI and Server-side includes checked).

Secondly, make sure that your site is correctly setup as an application (select website -> Actions -> View Applications). If it isn't there you'll need to add it.

Third thing to check is specifically the Handlers, which is accessed through IIS Manager -> Select website -> Handler Mappings -> Open Feature -> Make sure .asmx is there. I have it three times, WebServiceHandlerFactory-Integrated (handler System.Web.Handlers.WebAdminHandler), WebServiceHandlerFactory-ISAPI-2.0 (Isapi Module), and WebServiceHandlerFactory-ISAPI-2.0-64 (Isapi Module).

Finally you make sure you are using the correct .NET version for that application.

Again, apologies for the original duff answer.


Thanks Junto for the post! I tried so many things that other people were suggested but couldn't get my site to work. I followed your instructions and sure enough, my applications were listed under Sites in IIS, but were not shown in the Application Pools. I deleted the Applications and created them. Everything work as expected after that.

In case someone is interested of what I went through. I was migrating from IIS6 to IIS7. All the virtual directories and applications seem to be ported fine, but not all of them got into the Application Pools. So, if you're running into the same issue, "Error 400.17. If you want to serve this content as a static file, add an explicit MIME map", check your App Pool to make sure all your applications are shown.


This sounds like your HandlerMappings are a bit screwy. You can revert to known good a baseline (provided you haven't tinkered with the server wide Handler Mappings) by doing:

  1. Open IIS Manager
  2. Open the site in question
  3. In the Features View for the site open the Handler Mappings feature
  4. In the Actions pane (top right), click on "Revert To Parent"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜