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 the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
The old work around was to run aspnet_regiis -i
but this command seems to have been deprecated in Windows 8 yielding response This option is not supported on this version of the operating system. (...)
.
What would be the work around?
(I have successfully enabled regular aspx
pages already, so most of the IIS config seems healthy.)
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
.
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.
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
Please do the following two steps on IIS 8.0
Add new MIME type & HttpHandler
Extension: .svc, MIME type: application/octet-stream
Request path: *.svc, Type: System.ServiceModel.Activation.HttpHandler, Name: svc-Integrated
Source: Stackoverflow.com