简体   繁体   English

设置默认域后本地主机不再工作

[英]localhost no longer works after setting default domain

A program I need to run requires a FQDN to access the local IIS service.我需要运行的程序需要 FQDN 才能访问本地 IIS 服务。 Using localhost will not work.使用 localhost 将不起作用。 The solution is to add a default domain "local" so that MACHINE.local gets me to the local IIS and satisfies the need for a FQDN.解决方案是添加一个默认域“本地”,以便 MACHINE.local 将我带到本地 IIS 并满足对 FQDN 的需要。 Now, using localhost does not work.现在,使用 localhost 不起作用。 Tried adding it to the hosts file.尝试将其添加到主机文件中。 Is there another way to get localhost recognized?还有另一种方法可以识别本地主机吗? Running Windows 10.运行 Windows 10。

In this case, the problem was that my Visual Studio .csproj continued to have references to localhost.在这种情况下,问题是我的 Visual Studio .csproj 继续引用 localhost。 Changing those to .local resolved it.将它们更改为 .local 解决了它。 As I share this project with others, I needed to uncheck the "Apply server settings to all servers" checkbox under Web Properties.当我与其他人共享这个项目时,我需要取消选中 Web 属性下的“将服务器设置应用于所有服务器”复选框。 I still have not found a way to use localhost, but I no longer really need to.我仍然没有找到使用 localhost 的方法,但我不再真的需要了。

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

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