gpt4 book ai didi

azure - 主机头在 Azure 中不起作用

转载 作者:行者123 更新时间:2023-12-02 07:16:04 26 4
gpt4 key购买 nike

我在 Azure 中设置了多站点 Web 角色。在我的服务定义文件中,我有以下内容:

<Sites>
<Site name="Web" physicalDirectory="..\ABC.WebUx">
<Bindings>
<Binding name="Abc" endpointName="Endpoint1" hostHeader="www.abc.com" />
</Bindings>
</Site>
<Site name="DEF" physicalDirectory="..\DEF.WebUx">
<Bindings>
<Binding name="Def" endpointName="Endpoint1" hostHeader="www.def.com" />
</Bindings>
</Site>
<Site name="Ghi" physicalDirectory="..\GHI.WebUx">
<Bindings>
<Binding name="Ghi" endpointName="Endpoint1" hostHeader="www.ghi.com" />
</Bindings>
</Site>
</Sites>

<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>

当我尝试 www.def.com 和 www.ghi.com 时,主机头工作得很好,但是当输入 www.abc.com 时,它似乎忽略了物理目录,而是给了我这样的消息:

    Multiple types were found that match the controller named 'Home'. This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter.

The request for 'Home' has found the following matching controllers:
ABC.WebUx.Controllers.HomeController
DEF.WebUx.Controllers.HomeController
GHI.WebUx.Controllers.HomeController

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Multiple types were found that match the controller named 'Home'. This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter.

有谁知道为什么它似乎忽略默认“Web”的物理目录,顺便说一句,这是我链接到我的云服务的网站。

非常感谢您的帮助。

南希

最佳答案

如果您正在使用多个网站,我建议您观看此 Cloud Cover episode 。在这一集中,他们讨论了任何名为“Web”的网站都会被 Azure 视为特殊情况,因此物理目录等属性将被忽略。因此,要解决您的具体问题,请将您的第一个网站的名称从“Web”更改为“ABC”。

关于azure - 主机头在 Azure 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5128726/

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