我正在尝试在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.

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

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


当前回答

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

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

原因似乎是安装的顺序。

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

其他回答

打开下面的“打开或关闭Windows功能”

a) .Net Framework 3.5 - WCF HTTP激活和非HTTP激活

b)全部在WCF服务项下

在windows 10(客户端)上,你也可以使用脚本

Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName WCF-HTTP-Activation45 -All

注意,这是一个不同于服务器skus的命令

更具体地说:

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.

在Windows 8或Windows Server 2012上配置iis8时,安装顺序非常重要。

我在配置iis8时遇到了很多问题,但最终这些链接帮助了我

安装IIS 8 配置WCF

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

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