[Solution] The Service hosted by IIS fails.

Source: Internet
Author: User
Service hosted by IIS failed

If a service hosted by IIS fails, you may see one of the following symptoms:

  • When you browse a. SVC file, the file cannot be identified. The browser displays a blank page, or the text of the file rather than the help page of the service, as shown in the following example.

    <% @ Servicehost Language = C # DEBUG = "true" service = "Microsoft. servicemodel. samples. calculatorservice" %>

  • when attempting to access the Web-hosted service, the following exceptions may occur.

     unhandled exception: system. servicemodel. protocolexception: the remote server returned an unexpected response: (405) method not allowed. 

    If ASP is not installed.. Net or. SVC file type ing to ASPnet _ ISAPI. dll, this usually happens.
    to correct this problem, make sure that the aspnet_isapi is enabled as the Web service extension of IIS. You can use the IIS manager or run aspnet_regiis-I-enable from the. NET Framework installation directory to view and modify the settings. After you complete this operation, verify that ASP. NET is running. Therefore, put the test. aspx file in the \ Inetpub \ wwwroot directory and make sure that the file can be viewed in a browser.

  • If IIS is installed after Windows Communication Foundation (WCF) is installed, you must run the following command.

    "% WinDir % \ microsoft. Net \ framework \ V3.0 \ Windows Communication Foundation \ servicemodelreg.exe"-R

    This registers the required script ing in IIS.
    You must also ensure that the. SVC file type is mapped to aspnet_isapi.dll.

Verify that the SVC file type has been mapped to aspnet_isapi.dll in IIS 5.1 or 6.0.

    1. Open in Control Panel"Computer Management".

    2. Expand"Services and applicationsProgram"," Internet Information Service".

    3. Right-click"Website"And select"Attribute".

    4. In"Main directory"Click"Configuration".

    5. Verify that the. SVC file has been mapped to aspnet_isapi.dll in the application ing list. If the file has not been mapped:

      1. Click"Add".
      2. In"Add/edit application extension ing"In the dialog box, click"Browse".
      3. Browse to the folder containing aspnet_isapi.dll, and then click"Open".
      4. Specify. SVC as the extension.
      5. Ensure"Check whether the file exists"Not selected.
      6. Click"OK"And then click"OK"To return"Website attributes"Dialog box.
    6. Click"OK"Close the dialog box.

Verify that the SVC file type has been correctly mapped in IIS 7.0

  1. Open the Command Prompt window and typeStart inetmgrTo open the Internet Information Service (IIS) MMC snap-in.

  2. In the left-side pane, expand a node that contains a computer name, and then expand"Website"Node, and then select"Default website".

  3. InDouble-click "handler ing" in "function view".

  4. verify that the. SVC file has been mapped to aspnet_isapi.dll in the application ing list. If the file has not been mapped:

    1. click Add management handler .
    2. in "Request Path:" , type *. SVC .
    3. type system. servicemodel. activation. httphandler, system. servicemodel, version = 3.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089 .
    4. In the name: " text box, type SVC-integrated .
    5. click OK .
    6. click Add script ing .
    7. in "Request Path:" , type *. SVC .
    8. type % SystemRoot % \ microsoft In the executable file: " text box. net \ framework \ v2.0.50727 \ aspnet_isapi.dll .
    9. In the name: " text box, type svc-ISAPI-2.0 .
    10. use the move up/move down control to ensure that the managed handler (SVC-integrated) appears in the list before the aspnet_isapi (svc-ISAPI-2.0) handler.
    11. click OK .

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.