【发布时间】:2011-01-20 13:57:36
【问题描述】:
我有一个 WCF 服务托管在 Azure 的 webrole 中。
当我在开发结构中测试它时,它可以在我的网页(其他网络角色)上正常工作。
但是当我将它部署到云端时,它似乎并没有运行,尽管 webrole 已经准备好了。
当我使用 Fiddler 对我的 WCF 服务的公共方法之一执行 GET 时,我得到:
[提琴手] 连接到 xxxxxxxxxxxxxx.cloudapp.net 失败。 异常文本:连接尝试 失败是因为关联方做了 一段时间后无法正确响应 时间,或建立连接失败 因为连接的主机未能 回复yyyyyyyyyyyyyy
这是服务配置:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="GovGuard" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="GovGuard.Services">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="GuardServiceEndpointBinding" endpointName="GuardServiceEndpoint" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="DevelopmentConnectionString" />
<Setting name="GovGuardStorageConnectionString" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="GuardServiceEndpoint" protocol="http" port="81" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<LocalResources>
<LocalStorage name="MyCompany.GovGuard.Services.svclog" sizeInMB="1000" cleanOnRoleRecycle="false" />
</LocalResources>
</WebRole>
<WebRole name="GovGuard.Web">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="GuardWebEndpointBinding" endpointName="GuardWebEndpoint" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="GuardServiceUrl" />
<Setting name="DevelopmentConnectionString" />
<Setting name="GovGuardStorageConnectionString" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="GuardWebEndpoint" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<LocalResources>
<LocalStorage name="MyCompany.GovGuard.Web.svclog" cleanOnRoleRecycle="false" sizeInMB="1000" />
</LocalResources>
</WebRole>
</ServiceDefinition>
(编辑) 在我对问题的调查中,它可能是这样的:我使用 Microsoft.SqlServer.Types 程序集作为 WCF 项目中的文件引用。我使用 copy-local = true 将程序集复制到 bin 文件夹,并将其打包在 .csx 文件中。但是.... Microsoft.SqlServer.Types 还需要 SqlServerSpatial.dll 库(不是程序集)。我创建了一个 postbuild 脚本来将该 dll 复制到 bin 中,但我没有成功....
也许有人可以帮助我如何将 dll(不是程序集)打包到 .csx 文件中......
(编辑) 在这里找到它:http://msdn.microsoft.com/en-us/gg271395
【问题讨论】:
-
您可能需要共享一些代码...一个常见的错误是将端口设置为 80 以外的值。可能需要检查您的 ServiceDefinition.csdef。