【问题标题】:Two web applications on one Web Role - config issue一个 Web 角色上的两个 Web 应用程序 - 配置问题
【发布时间】:2013-07-02 15:06:15
【问题描述】:

我正在尝试将两个 Web 应用程序发布到一个 Web 角色上,就像 this article

我有以下错误:

角色“AzureWebTest2”存在于配置文件中,但服务定义中没有定义。

这是我的ConfigDefinition.csdef

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="AzureWebTestCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
  <WebRole name="AzureWebTest" vmsize="Small">
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="AzureWebTest.mydomain.com" />
        </Bindings>
      </Site>
      <Site name="Web2" physicalDirectory="..\..\AzureWebTest2">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="AzureWebTest2.mydomain.com"  />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
    </Endpoints>
  </WebRole>
</ServiceDefinition>

我的云服务项目:

我认为这是因为ConfigDefinition.csdef 中没有&lt;WebRole name="AzureWebTest2"&gt; 条目。我该怎么做?

【问题讨论】:

    标签: .net azure azure-sql-database azure-storage azure-web-roles


    【解决方案1】:

    我认为问题在于您的 CloudService 部署项目的映像中包含了第二个角色。删除该角色。您的项目通过&lt;site&gt; 标记上的physicalDirectory 属性包含。

    【讨论】:

    • 你是对的。在 ServiceDefinition.csdef 文件中有一个 Web 角色和两个站点,但在 CloudService 部署中定义了两个 Web 角色。
    【解决方案2】:

    在 ServiceDefinition.csdef 文件中,您有一个包含两个站点的 Web 角色,但在 CloudService 项目中,您添加了两个 Web 角色。 您需要删除第二个 Web 角色“AzureWebTest2”。我认为现在一切都应该正常了。如果没有请告诉。

    也许这个链接可以帮助你:

    http://blog.elastacloud.com/2011/01/11/azure-running-multiple-web-sites-in-a-single-webrole/ http://www.wadewegner.com/2011/02/running-multiple-websites-in-a-windows-azure-web-role/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-18
      • 2018-08-14
      • 2011-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-20
      • 2012-02-08
      相关资源
      最近更新 更多