C# WCF服务突然拒绝在VS2017调试中启动

C# WCF服务突然拒绝在VS2017调试中启动,c#,wcf,C#,Wcf,我有一个WCF服务,已经运行多年,我经常更新/添加。在部署到生产服务器之前,我通常从VS中测试服务。我最近尝试添加一个新端点,如(DeliveryReport)、接口和实现: [ServiceContract (Namespace = "carsweb.no/")] public interface IService1 { [OperationContract] [WebInvoke] string DeliveryReport(s

我有一个WCF服务,已经运行多年,我经常更新/添加。在部署到生产服务器之前,我通常从VS中测试服务。我最近尝试添加一个新端点,如(DeliveryReport)、接口和实现:

[ServiceContract (Namespace = "carsweb.no/")]
    public interface IService1
    {
        [OperationContract]
        [WebInvoke]
        string DeliveryReport(string s);

        //[OperationContract]
        //string GetData(string value); several here....

  public class Verksted : IService1
    {
        public string DeliveryReport(string rep)
        {
            return "You posted " + rep;
        }
然后,VS中的WCF测试客户端拒绝添加服务,并向我发送了以下消息: “添加服务失败。可能无法访问服务元数据。请确保您的服务正在运行并公开元数据。” 然后我注释掉了我所有的更改(不是很多),同样删除了对“ServiceModel.Web”的引用,我不得不添加它。但是我在启动WCF测试客户端时仍然会遇到相同的错误,尽管一切都和以前一样。没有对配置进行任何更改(我已检查)。配置前后相同:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
  </startup>
  <configSections>
      <section name="CarsGlobalService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
    </sectionGroup>
  </configSections>
  <appSettings>
    <add key="LogFolder" value="C:\usr\INF05\TMP\"/>
    <add key="ConfigFolder" value="c:\CarsGlobal\Config\"/>
  </appSettings>
  <system.web>
    <compilation debug="true"/>
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_ICommissionFacade" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <security mode="Transport"/>
        </binding>
        <binding name="MedlemServiceSoap">
          <security mode="Transport"/>
        </binding>
        <binding name="dbsBinding" sendTimeout="00:10:00">
          <security mode="Transport"/>
        </binding>
        <binding name="ServiceSoap"/>
        <binding name="ApplicationWebService" maxReceivedMessageSize="20000000">
          <security mode="Transport"/>
        </binding>
        <binding name="emsPortBinding"/>
        <binding name="VerkstedSoap" maxReceivedMessageSize="20000000">
          <security mode="Transport"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint Several endpoints in here which all works well"/>
    </client>
    <services>
      <service name="CarsGlobalService.Verksted">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8733/Design_Time_Addresses/CarsGlobalService/Verksted/mex"/>
          </baseAddresses>
        </host>
        <endpoint address="" binding="basicHttpBinding" contract="CarsGlobalService.IService1">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="True"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>
几天前我试着做一些其他的WCF服务,我得到了同样的信息。
是网络、我的电脑、我的VS环境还是什么?我完全卡住了

服务baseAddress包含mex端点地址。您是否尝试使用与当前不同的baseAddress?我认为这与配置无关,与之前的配置完全相同。我倾向于认为我的电脑或VS环境有问题。除非有人能给我一个好的理由…可能是防火墙。如果启用了防火墙,则可以允许端口8733。
Error: Cannot obtain Metadata from http://localhost:8733/Design_Time_Addresses/CarsGlobalService/Verksted/mex?wsdl If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  
For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    
URI: http://localhost:8733/Design_Time_Addresses/CarsGlobalService/Verksted/mex?wsdl    
Metadata contains a reference which cannot be resolved: http://localhost:8733/Design_Time_Addresses/CarsGlobalService/Verksted/mex?wsdl.    
No endpoints listening on http://localhost:8733/Design_Time_Addresses/CarsGlobalService/Verksted/mex?wsdl, som kunne godta meldingen. Dette skyldes ofte en feil adresse eller SOAP-handling. Se InnerException, hvis tilgjengelig, hvis du vil ha flere detaljer.    
Cannot connect to the external server.   
Cannot connect because the computer refused connection on 127.0.0.1:8733HTTP GET Error    
URI: http://localhost:8733/Design_Time_Addresses/CarsGlobalService/Verksted/mex?wsdl    
Error occurred during downloading of http://localhost:8733/Design_Time_Addresses/CarsGlobalService/Verksted/mex?wsdl.    
Cannot connect to the external server    Cannot connect because the target computer refused connection 127.0.0.1:8733