4

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.

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
intermension
  • 2,593
  • 2
  • 18
  • 14
  • Are these the MS Report Viewer components, if so which version? 2005 or 2008? – Kev Feb 05 '10 at 13:33
  • @Kev - 2005 components. They just spit out a blank page in non -debug mode. No server error is generated to capture. But if I attach to the server using a debug version of the code they are falling over when RSReport tries to do its thing claiming RSReport is null. – intermension Feb 05 '10 at 21:10

3 Answers3

5

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.

Rebecca
  • 13,914
  • 10
  • 95
  • 136
  • Hi, As per the question, the server is already in classic mode - this is what is causing the issue. The question is not how to put IIS7 into classic mode but rather what configuration settings are required to enable web services for an IIS 7 server already in classic mode. – intermension Feb 05 '10 at 08:24
  • Hi, Yes its definitely a handlers issue. Web services need to routed to something other than the static file handler. I cant say I ever had the need to manually adjust the settings though so Im not sure which gets mapped to what. I will have another tinker now (that Ive had some sleep) using the info you have provided. – intermension Feb 05 '10 at 21:26
1

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.

Vicki
  • 11
  • 1
0

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"
Kev
  • 118,037
  • 53
  • 300
  • 385
  • Yes. Sure does. Unfortunately I don't have access to IIS Manager. The app will be run in a shared environment. Everything is fine on the test server IIS7.0 so my thoughts are that something is different in the machine.config file on the hosted server so i need to explicitly set or overwrite something in web.config for this application. – intermension Feb 05 '10 at 21:29