gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 03:15:01 24 4
gpt4 key购买 nike

当我在计算机上运行 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 文件中定义不同的端口。

关于c# - 发布到 Azure 云服务的 WCF 无法访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29508619/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com