简体   繁体   English

IIS Express:无法将 url 与子域绑定

[英]IIS Express: Cannot bind url with subdomain

I tried to bind a url with subdomain into my application:我尝试将带有子域的 url 绑定到我的应用程序中:

xyz.localhost:44310

Every time I change my applicationhost.config , I cannot run my debugger from Visual Studio 2019 .每次更改applicationhost.config时,我都无法从Visual Studio 2019运行调试器。

There error is:有错误是:

Unable to connect to web server "IIS Express"无法连接到 web 服务器“IIS Express”

I have to delete the applicationhost.config to be able to run it again, but the bindings will be reverted to default.我必须删除applicationhost.config才能再次运行它,但绑定将恢复为默认值。

This is my binding:这是我的绑定:

<binding protocol="http" bindingInformation="*:8130:localhost" />
<binding protocol="https" bindingInformation="*:44310:localhost" />
<binding protocol="https" bindingInformation="*:44310:xyz.localhost" />

The default binding is:默认绑定是:

<binding protocol="http" bindingInformation="*:8130:localhost" />
<binding protocol="https" bindingInformation="*:44310:localhost" />

I want to add xyz.localhost:44310 binding.我想添加xyz.localhost:44310绑定。 Also I want to use * wildcard like *.localhost:44310 .我也想使用*通配符,例如*.localhost:44310

How can I do this?我怎样才能做到这一点?

Nvm I have to add both http and https : Nvm 我必须同时添加httphttps

<binding protocol="http" bindingInformation="*:8130:localhost" />
<binding protocol="http" bindingInformation="*:8130:xyz.localhost" />
<binding protocol="https" bindingInformation="*:44310:localhost" />
<binding protocol="https" bindingInformation="*:44310:xyz.localhost" />

Then it works然后它工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM