我正在尝试在Windows Server 2012 build 8400上的IIS8上运行WCF服务。

在安装web角色时,WCF的东西(在3.51之下)没有像Windows Server 2008那样被发现。

当安装svc处理程序映射是缺失的,所以我做了一个:

%windir%\Microsoft.NET\Framework\v3.0\WindowsCommunication Foundation\ServiceModelReg.exe –i

现在处理程序映射在那里,但我仍然得到:

The resource you are looking for does not have a handler associated with it.

(我删除了静态文件处理程序。)

为了使用模拟,该站点正在使用经典的管道。


当前回答

使用PowerShell,您可以安装所需的功能:

Add-WindowsFeature 'NET-HTTP-Activation'

其他回答

Windows 8和IIS8

点击Windows + X 选择程序和功能(列表中的第一项) 在左侧选择“打开或关闭Windows功能” 展开。net Framework 4.5 Advanced Services 扩展WCF服务 启用HTTP激活

更具体地说:

Run Server Manager (on task bar and start menu) Choose the server to administer (probably local server) Scroll down to "Roles and Features" section. Choose "Add Role or Feature" from Tasks drop down On "Add Role or Feature Wizard" dialog, click down to "Features" in list of pages on the left. Expand ".Net 3.5" or ".Net 4.5", depending on what you have installed. (you can go back up to "roles" screen to add if you don't have. Under "WCF Services", check the box for "HTTP-Activation". You can also add non-http types if you know you need them (tcp, named pipes, etc). Click "Install" Button.

使用PowerShell,您可以安装所需的功能:

Add-WindowsFeature 'NET-HTTP-Activation'

现在我更喜欢通过脚本来实现这一点

REM install the needed Windows IIS features for WCF
dism /Online /Enable-Feature /FeatureName:WAS-WindowsActivationService
dism /Online /Enable-Feature /FeatureName:WAS-ProcessModel
dism /Online /Enable-Feature /FeatureName:WAS-NetFxEnvironment
dism /Online /Enable-Feature /FeatureName:WAS-ConfigurationAPI
dism /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation
dism /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation45

REM Feature Install Complete
pause

我们设法解决了Windows Server 2012下的错误:

从“删除角色和功能向导”中删除。net Framework 4.5 Features/ASP。NET 4.5及其所有相关特性 重新安装已删除的特性。

原因似乎是安装的顺序。

另外,确保在WCF服务下安装了HTTP激活。