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

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

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


当前回答

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

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

其他回答

它是。net框架的HTTP激活特性 Windows进程激活功能也是必需的

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

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

我不得不在。net Framework 4.5高级服务> WCF服务中启用HTTP激活

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

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

b)全部在WCF服务项下

对于Windows 8机器,没有“服务器管理器”应用程序(至少我没能找到它)。

不过我还是解决了这个问题。我不确定我在哪个顺序做了以下操作,但看起来以下操作中的一个/几个有帮助:

Turn ON the following on 'Turn Windows Features on or off' a) .Net Framework 3.5 - WCF HTTP Activation and Non-Http Activation b) all under WCF Services (as specified in one of the answers to this question) executed "ServiceModelReg.exe –i" in "%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\" folder Registered ASP.NET 2.0 via two commands ( in folder C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727): aspnet_regiis -ga "NT AUTHORITY\NETWORK SERVICE" aspnet_regiis -iru Restarted PC... it looks like as a result as actions ## 3 and 4 something got broken in my ASP.NET configuration Repeat action #2 Install two other options from the "Programs and Features": .Net Framework 4.5 Advanced Services. I checked both sub options: ASP.NET 4.5 and WCF services Restart App Pool.

序列有点疯狂,但这对我有帮助,可能也会对其他人有帮助