【发布时间】:2020-02-28 05:25:41
【问题描述】:
我正在尝试在 https://localhost:44301 和 https://sub.localhost.test 上本地呈现我的 asp.net 核心应用程序。
我将以下内容添加到我的hosts 文件127.0.0.1 sub.localhost.test。然后我将C:/ProjectName/.vs/config/applicationhost.config文件中的绑定信息编辑为如下
<site name="ProjectName" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\ProjectName" />
</application>
<bindings>
<binding protocol="https" bindingInformation="*:44301:localhost" />
<binding protocol="https" bindingInformation="sub.localhost.test" />
</bindings>
</site>
我也喜欢<binding protocol="https" bindingInformation="*:44301:sub.localhost.test" />。但是,当我转到https://sub.localhost.test 时,我得到Unable To Connect 错误。
是否可以在 https://localhost:44301 andhttps://sub.localhost.test` 上运行我的本地项目?如果有,怎么做?
【问题讨论】:
-
花点时间了解什么是站点绑定,然后答案应该很清楚了docs.jexusmanager.com/tutorials/binding-diagnostics.html
-
@LexLi,我安装了 JexusManager 并直接从那里添加了绑定,以确保我没有遗漏任何东西,但它仍然没有呈现。当我查看正在运行的“IIS Express”时,我什至没有看到子域被列为有效网站。我只看到一个指向 https 的链接和带有 localhost 的 https 链接。
-
从 Jexus Manager 运行实际诊断并检查报告内容。
-
@LexLi 清除我的浏览器数据后,我现在收到错误消息。我得到的错误是 `HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure` 不是 localhost:44301 运行时没有错误。
-
这能回答你的问题吗? Get Visual Studios to use subdomain?
标签: visual-studio asp.net-core visual-studio-2017 asp.net-core-2.0 iis-express