No se pueden servir servicios WCF en IIS en Windows 8


Cuando intento servir un servicio WCF en IIS en una máquina con Windows 8, obtengo el conocido error

La página que está solicitando no se puede servir debido a la configuración de la extensión. Si la página es un script, agregue un controlador. Si el archivo debe descargarse, agregue un mapa MIME.

El antiguo trabajo era ejecutar aspnet_regiis -i pero este comando parece haber sido obsoleto en Windows 8 dando respuesta This option is not supported on this version of the operating system. (...).

¿Cuál sería el trabajo alrededor?

(tengo ya se han habilitado correctamente las páginas regulares aspx, por lo que la mayor parte de la configuración de IIS parece saludable.)

Author: Stijn, 2012-07-13

5 answers

Parecía una obviedad; el servicio WCF debería habilitarse usando Programs and Features -> Turn Windows features on or off en el Panel de control. Vaya a .NET Framework Advanced Services -> WCF Services y habilite HTTP Activation como se describe en esta entrada de blog en mdsn.

Desde el símbolo del sistema (como administrador), puede ejecutar:

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

Si obtiene un error, use el siguiente

C:\> DISM /Online /Enable-Feature /all /FeatureName:WCF-HTTP-Activation
C:\> DISM /Online /Enable-Feature /all /FeatureName:WCF-HTTP-Activation45
 355
Author: faester,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-26 08:31:03

Para Windows Server 2012, la solución es muy similar a la de Faester (ver arriba). Desde el Administrador del servidor, haga clic en Add roles and features, seleccione el servidor apropiado y luego seleccione Features. Debajo de .NET Framework 4.5 Features, verás WCF Services, y debajo de eso, encontrarás HTTP Activation.

 87
Author: Bill Moon,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-01-03 19:16:50

Realice los siguientes dos pasos en IIS 8.0

Añadir nuevo tipo MIME & HttpHandler

  1. Extensión: .vpc, Tipo MIME: application / octet-stream

  2. Ruta de Solicitud: *.vpc, Tipo: System.ServiceModel.Activación.HttpHandler, Nombre: svc-Integrated

 10
Author: Jeneesh Velayudhan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-03-05 06:28:25

Esta es realmente la misma solución que la de Faester y la de Bill Moon, pero así es como se hace con PowerShell:

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

Por supuesto, tampoco hay nada que te impida llamar a DISM desde PowerShell.

 3
Author: JamesQMurphy,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-01-15 03:35:25

También puede lograr esto activando la función de Windows. introduzca la descripción de la imagen aquí introduzca la descripción de la imagen aquí

 1
Author: Mohit Dharmadhikari,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-01 05:44:55