asp.net - 找不到本地主机 (404) iis

标签 asp.net iis visual-studio-2012 localhost

我的计算机上的 DNS localhost 有几个问题。

当我的 visual studio 或任何浏览器查找 localhost 时,一些指令正在重定向我的所有浏览器,包括 127.0.0.1 以外的其他地方的 visual studio。

哪里会发生这种事?我最近更改了我的主机文件以将 localhost 指向其他地方,但后来它不起作用,所以我将其切换回来,所以这不是问题。

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost

我也卸载并安装了 IIS,所以不是 iis 没有正确重定向的问题..

由于这个问题,我无法运行 Visual Studio 解决方案。

我试过固定 127.0.0.1 并且它有响应,我也试过 localhost 并且它也有效,但是当我在浏览器上键入 localhost 时它会重定向到“404”页面。

最佳答案

确保 IIS 实际上配置为监听 127.0.0.1(也许您之前删除了绑定(bind)?)

netsh http show iplisten<br/> IP addresses present in the IP listen list: 127.0.0.1

您可以像这样添加额外的 IP:

netsh http add iplisten ipaddress=10.0.0.10

关于asp.net - 找不到本地主机 (404) iis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21241709/

相关文章:

visual-studio - Visual Studio 2012 - Intellisense 有时会消失/损坏

asp.net - 'System.Runtime.Serialization.IExtensibleDataObject' 在程序集中定义

angular - IIS 允许路由到虚拟目录

javascript - 为 Web API URL 配置 Angularjs 路由

mysql - 推荐用于 Windows 的 MySQL 调优实用程序

jquery - 使用 div 显示在两个选项卡/表格之间切换

c# - 确认代码隐藏中的函数

asp.net - .NET MVC2 Master 上的多个部分 View ,也可通过 AJAX 单独加载

mysql - 在 ASP.net (vb.net) 中使用参数将数据插入 MySqlDatabase 时出现问题

c++ - 无法在 Visual Studio 2012 中打开头文件