【问题标题】:Error: zero application (non-infrastructure) endpoints on Azure错误:Azure 上的零应用程序(非基础设施)终结点
【发布时间】:2014-08-26 01:22:32
【问题描述】:

我有一个正在运行的成熟 WCF 服务,我正尝试将它作为 Web 角色部署在 Windows Azure 上(当然,使用自定义包装器)。我的 RoleEntryPoint.OnStart() 方法创建了一个 ServiceHost 实例,它在该实例中出现零应用程序端点错误。配置(web.config)服务模型部分为:

  <system.serviceModel>
    <services>
      <service name="Linguasys.QualitativeAnalysis.Processing" behaviorConfiguration="defaultServiceBehavior">
        <endpoint address="" behaviorConfiguration="wcfAzureWrapperStoryMapping.StoryMapperAspNetAjaxBehavior" binding="webHttpBinding" contract="Linguasys.QualitativeAnalysis.IProcessing" />
<!--
        <endpoint address="soap" behaviorConfiguration="" binding="basicHttpBinding" contract="Linguasys.QualitativeAnalysis.IProcessing" />
-->
  </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="wcfAzureWrapperStoryMapping.StoryMapperAspNetAjaxBehavior">
  <!--
          <enableWebScript />
          -->
          <webHttp faultExceptionEnabled="true" />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="defaultServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <webHttpBinding></webHttpBinding>
      <basicHttpBinding></basicHttpBinding>
    </bindings>
    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
      <!--
      <serviceActivations>
        <add relativeAddress="StoryMapper.svc" service="Linguasys.QualitativeAnalysis.Processing"/>
      </serviceActivations>
      -->
    </serviceHostingEnvironment>
  </system.serviceModel>

不要介意激活位、基本的 HTTP 绑定等。它们是后来添加的,看看它是否会起作用。

我看到我的web.config 最终出现在siterootapproot 以及所有其他地方。

我错过了什么?

【问题讨论】:

    标签: wcf azure


    【解决方案1】:

    您的 RoleEntryPoint.OnStart() 方法在 WaIISHost.exe 中运行,它对您的 web.config 一无所知。有关详细信息,请参阅 http://azure.microsoft.com/blog/2010/12/02/new-full-iis-capabilities-differences-from-hosted-web-core/,有关进程如何运行的信息,请参阅 http://blogs.msdn.com/b/kwill/archive/2011/05/05/windows-azure-role-architecture.aspx

    两种选择:

    1. 将您的 WCF 配置移动到 WebRole1.dll.config(或任何您的角色入口点二进制文件的名称)。确保将 .config 设置为 Content 并复制到本地。
    2. 在 w3wp 中实例化您的 ServiceHost(即 Global.asax)。

    【讨论】:

    • 一个非常有用和有用的答案,谢谢。我会试一试,让你知道结果。也就是说,我一直在到处看到提到web.config,例如“网络角色使用web.config,工作角色使用app.config”。奇怪。
    • WebRoles 仍然使用 web.config 来配置与您的 Web 开发相关的任何内容(即标准 web.config 内容)。通常,您的 WCF 主机是 w3wp.exe,因此 web.config 是正确的。您的场景更加自定义。
    猜你喜欢
    • 2019-03-15
    • 2012-04-06
    • 2011-01-20
    • 2011-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多