无法运行WCF数据服务示例

时间:2014-08-01 19:56:39

标签: c# .net wcf wcf-data-services

运行Windows 7企业版。已安装VS2013。

我无法运行任何WCF数据服务应用程序。 (例如http://code.msdn.microsoft.com/WCF-Data-50-for-OData-v3-53074189

我收到以下例外:

Configuration endpoint extension 'standardEndpoints/webHttpEndpoint' could not be found. Verify that this endpoint extension is properly registered in system.serviceModel/extensions/endpointExtensions and that it is spelled correctly.

我有一个同事尝试,他们能够立即运行样品,毫无例外。

我觉得这意味着缺少某种WCF组件,但Google对此没有任何帮助。

有人可以帮忙吗?

2 个答案:

答案 0 :(得分:1)

来自MSDN - Deploying an Internet Information Services-Hosted WCF Service

  

确保正确安装IIS,ASP.NET和WCF   注册

     
     

必须为IIS托管的WCF服务安装WCF,IIS和ASP.NET   功能正常。安装WCF的过程(作为的一部分   WinFX),ASP.NET和IIS因操作系统版本而异   正在使用。有关安装WCF和WinFX的更多信息,   请参阅Microsoft .NET Framework 4 Web Installer。说明   安装IIS可以在安装IIS中找到。

     

WinFX的安装过程会自动注册WCF   如果IIS已存在于计算机上,则使用IIS。如果安装了IIS   在WinFX之后,需要一个额外的步骤来注册WCF   IIS和ASP.NET。您可以按照以下方式执行此操作,具体取决于您   操作系统:

     

•Windows XP SP2,Windows 7和Windows Server   2003:使用ServiceModel注册工具(ServiceModelReg.exe)   使用IIS注册WCF的工具:要使用此工具,请键入   Visual Studio命令提示符中的ServiceModelReg.exe / i / x。您可以   单击开始按钮,选择全部,打开此命令提示符   程序,Microsoft Visual Studio 2012,Visual Studio工具和   Visual Studio命令提示符

     

•Windows Vista:安装Windows Communication Foundation   WinFX的Activation Components子组件。要做到这一点,在   单击控制面板,单击添加或删除程序,然后单击添加/删除   Windows组件。这将激活Windows组件向导。

     

•Windows 7:

     

最后,您必须验证ASP.NET是否已配置为使用.NET   框架版本4.您可以通过运行ASPNET_Regiis工具来完成此操作   使用-i选项。有关更多信息,请参阅ASP.NET IIS注册   工具

我之前看到过这个问题,我将配置WCF服务运行在新站起来的服务器和我从头开始站起来的开发/暂存环境上。此链接上的信息已经多次协助。

答案 1 :(得分:0)

我想通了..问题是我在某个方面错过了我的machine.config中webHttpEndPoint的扩展名定义。

e.g。

  <system.serviceModel>
    <extensions>            
        <endpointExtensions>                
            <add name="webHttpEndpoint" type="System.ServiceModel.Configuration.WebHttpEndpointCollectionElement, System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />                
        </endpointExtensions> 
    </extensions>
  <system.serviceModel>
相关问题