不带.svc扩展名的WCF端点地址

不带.svc扩展名的WCF端点地址,wcf,configuration,iis-7.5,Wcf,Configuration,Iis 7.5,我已经启动并运行了WCF服务,但今天我想,如果我从realative address中删除.svc扩展并以这种方式访问我的服务,会怎么样?净。tcp://serveraddress/services/service 但我一更改配置文件程序就并没有启动。此程序和服务使用.NET 4.0开发,WCF 4 ad服务本身托管在IIS 7.5中 在IIS中托管服务时,可以通过这种方式访问服务?这可能是IIS中处理程序的问题。我还使用了无扩展的WCF服务,并修改了web.config文件以使其正常工作。将此

我已经启动并运行了WCF服务,但今天我想,如果我从realative address中删除.svc扩展并以这种方式访问我的服务,会怎么样?净。tcp://serveraddress/services/service 但我一更改配置文件程序就并没有启动。此程序和服务使用.NET 4.0开发,WCF 4 ad服务本身托管在IIS 7.5中


在IIS中托管服务时,可以通过这种方式访问服务?

这可能是IIS中处理程序的问题。我还使用了无扩展的WCF服务,并修改了web.config文件以使其正常工作。将此添加到web.config以查看是否有帮助:

<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
  <remove name="UrlRoutingModule" />
  <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>

<handlers> 
<remove name="svc-Integrated-4.0" />
<add name="svc-Integrated-4.0" path="*" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
      <add 
        name="UrlRoutingHandler" 
        preCondition="integratedMode" 
        verb="*" path="UrlRouting.axd" 
        type="System.Web.HttpForbiddenHandler, System.Web,  
          Version=2.0.0.0, Culture=neutral,  
          PublicKeyToken=b03f5f7f11d50a3a"/> 
    </handlers> 
</system.webServer>

我在没有svc文件的情况下托管了WCF服务。我正在将ServiceRoute添加到Global.asax文件中的应用程序启动方法中的RouteTable

protected void Application_Start(object sender, EventArgs e)
{
    RouteTable.Routes.Add(new ServiceRoute("AdminDataService", new WebServiceHostFactory(), typeof(AdminService)));
    RouteTable.Routes.Add(new ServiceRoute("AuthenticationService", new WebServiceHostFactory(), typeof(AuthenticationService)));
}

您是否尝试将IIS中应用程序的默认页面更改为指向svc文件,或者,您是在试图避免所有这些吗?我没有尝试更改默认页面,但我更愿意避免,因为默认页面不是一个好的解决方案,因为每个服务都需要相同的文件名,而这是不可能的。我仍然无法达到预期的结果。有人可以解释如何配置吗有人知道怎么做吗?这里的问题是我使用的是net.tcp绑定。如果在浏览器的http请求中引用它,它可以工作,但不适用于net.tcp