Asp.net mvc 两个端点想要共享同一个ListenUri,但我只有一个

Asp.net mvc 两个端点想要共享同一个ListenUri,但我只有一个,asp.net-mvc,wcf,Asp.net Mvc,Wcf,关于这一点已经有很多问题,但在其他情况下,人们似乎正试图有多个终点。在我的例子中,我只有一个端点,并且只想要一个端点。只有在启用证书传输安全且仅在开发计算机上时,才会发生错误 我通过MVC中的ServiceRoute实现了WCF服务: RouteTable.Routes.Add(新服务路由(“MyServices”,新WebServiceHostFactory(),typeof(MyServices)) 整个serviceModel仅包含以下内容: <system.serviceModel

关于这一点已经有很多问题,但在其他情况下,人们似乎正试图有多个终点。在我的例子中,我只有一个端点,并且只想要一个端点。只有在启用证书传输安全且仅在开发计算机上时,才会发生错误

我通过MVC中的ServiceRoute实现了WCF服务:

RouteTable.Routes.Add(新服务路由(“MyServices”,新WebServiceHostFactory(),typeof(MyServices))

整个serviceModel仅包含以下内容:

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<standardEndpoints>
  <webHttpEndpoint>
    <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true">
      <!--<security mode="Transport">
        <transport clientCredentialType="Certificate" />
      </security>-->          
    </standardEndpoint>
  </webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>

我可以将代码放在不同的环境中,并按照预期工作。WTF

这是Visual Studio 2012 RC中的一个bug。尽管我使用的是VS 2010,但安装了VS 2012 RC导致了这个问题。一旦我卸载了它,这个问题就解决了。只需确保您遵循2012年的特定卸载说明,因为如果您使用控制面板中的“卸载程序”选项卸载它,它将中断VS 2010。。。这是Visual Studio 2012 RC中的一个bug。尽管我使用的是VS 2010,但安装了VS 2012 RC导致了这个问题。一旦我卸载了它,这个问题就解决了。只需确保您遵循2012年的特定卸载说明,因为如果您使用控制面板中的“卸载程序”选项卸载它,它将中断VS 2010。。。我学到了艰苦的方法。

现在可以从MS:或根据您的Windows版本获得修复。现在可以从MS:或根据您的Windows版本获得修复。
A binding instance has already been associated to listen URI 'https://my.dev.machine.local/MyServices'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config.