Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法访问发布到Azure云服务的WCF_C#_Wcf_Azure_Azure Cloud Services - Fatal编程技术网

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

C# 无法访问发布到Azure云服务的WCF,c#,wcf,azure,azure-cloud-services,C#,Wcf,Azure,Azure Cloud Services,当我在我的计算机上运行WCF时,它的工作方式与预期的一样,但是当我发布它(从VS2013)时,我无法访问它 当我尝试时: 或 我明白了 No HTTP resource was found that matches the request URI 这是我的web.config文件: <?xml version="1.0"?> <configuration> <connectionStrings> <add name="Stora

当我在我的计算机上运行WCF时,它的工作方式与预期的一样,但是当我发布它(从VS2013)时,我无法访问它

当我尝试时:

我明白了

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>

也许预配置远程桌面正在解决这些问题

知道为什么会这样吗?什么原因

更新

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

没有HTTP资源

其他信息:

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


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


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

您是否检查了端口80的端点是否为VM或云服务打开?我更新了我的原始帖子@SimonW。我建议您将WCF服务托管在工作者角色云服务中,通过手动配置,您将确保能够访问您的服务
    <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>