无法访问发布到 Azure 云服务的 WCF

WCF published to Azure Cloud Service is unreachable

当我 运行 WCF 在我的计算机上时,它按预期工作,但是当我发布它时(从 VS 2013)我无法访问它。

当我尝试时:

http://myWCF.cloudapp.net/Service.svc

http://myWCF.cloudapp.net

我明白了

No HTTP resource was found that matches the request URI

这是我的 web.config 文件:

    <?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="Storage" connectionString="DefaultEndpointsProtocol" />
    <add name="DB" connectionString="Server=tcplient" />
  </connectionStrings>
  <system.diagnostics>
    <trace>
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          name="AzureDiagnostics">
          <filter type="" />
        </add>
      </listeners>
    </trace>
  </system.diagnostics>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false"
      multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
    -->
    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>

也许预配置远程桌面存在问题?

知道为什么会这样吗?是什么原因造成的?

更新

按预期发布其作品后(好)但在我使用远程桌面连接连接到服务并在机器上安装我的软件后,我得到了

No HTTP resource...

附加信息:

这是 csdef 文件:(带有端点)

    <ServiceDefinition name="FilteringServiceAzureWCF" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-06.2.4">
  <WebRole name="WCFFilteringService" vmsize="Small">
    <Runtime executionContext="elevated" />
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
    </Endpoints>
    <ConfigurationSettings>
    </ConfigurationSettings>
    <Imports>
      <Import moduleName="RemoteAccess" />
      <Import moduleName="RemoteForwarder" />
    </Imports>
  </WebRole>
</ServiceDefinition>

请确保您的端口 80 未被计算机上的任何其他程序占用。

WCF 默认使用端口 80,但是您可以在 csdef 文件中定义不同的端口。