Cannot serve WCF services in IIS on Windows 8

后端 未结 6 1430
不知归路
不知归路 2020-11-29 15:52

When I try to serve a WCF service on IIS in a Windows 8 machine, I get the well known error

The page you are requesting cannot be served because of th

相关标签:
6条回答
  • 2020-11-29 16:26

    Please do the following two steps on IIS 8.0

    Add new MIME type & HttpHandler

    1. Extension: .svc, MIME type: application/octet-stream

    2. Request path: *.svc, Type: System.ServiceModel.Activation.HttpHandler, Name: svc-Integrated

    0 讨论(0)
  • 2020-11-29 16:27

    you can add this code to web.config in asp mvc

       <system.webServer>
        <staticContent>
          <remove fileExtension=".srt" />
          <mimeMap fileExtension=".srt" mimeType="text/srt" />
          <remove fileExtension=".vtt" />
          <mimeMap fileExtension=".vtt" mimeType="text/vtt" />
        </staticContent>
      </system.webServer>
    

    you can change file extension with your file extension

    0 讨论(0)
  • 2020-11-29 16:28

    For Windows Server 2012, the solution is very similar to faester's (see above). From the Server Manager, click on Add roles and features, select the appropriate server, then select Features. Under .NET Framework 4.5 Features, you'll see WCF Services, and under that, you'll find HTTP Activation.

    0 讨论(0)
  • 2020-11-29 16:35

    You can also achieve this by Turning windows feature ON.

    0 讨论(0)
  • 2020-11-29 16:36

    Seemed to be a no brainer; the WCF service should be enabled using Programs and Features -> Turn Windows features on or off in the Control Panel. Go to .NET Framework Advanced Services -> WCF Services and enable HTTP Activation as described in this blog post on mdsn.

    From the command prompt (as admin), you can run:

    C:\> DISM /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation
    C:\> DISM /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation45
    

    If you get an error then use the below

    C:\> DISM /Online /Enable-Feature /all /FeatureName:WCF-HTTP-Activation
    C:\> DISM /Online /Enable-Feature /all /FeatureName:WCF-HTTP-Activation45
    
    0 讨论(0)
  • 2020-11-29 16:40

    This is really the same solution as faester's solution and Bill Moon's, but here's how you do it with PowerShell:

    Import-Module Servermanager
    Add-WindowsFeature AS-HTTP-Activation
    

    Of course, there's nothing stopping you from calling DISM from PowerShell either.

    0 讨论(0)
提交回复
热议问题