我在做什么:

开放Visual Studio社区2015 File ->新建->项目 在Visual c#: Web -> ASP下。NET Web应用程序 Web应用程序 并按f5弹出错误“无法连接到web服务器'IIS Express'”。

删除applicationhost。config,位于Documents\IISExpress\config中,不会更改错误消息。(程序文件和程序文件(x86)中也有一个IISExpress文件夹。)

我注意到一件事,我不知道这是不是问题

引用文件'lib/jquery-validation/jquery.validate.js'未找到。

我有一堆破烂,但我没注意到里面有什么。这里有一些内容:

“框架”:{“框架”

我没有注意到问题,但我有网络数据,如果这可以帮助找出为什么我不能连接到web服务器。我立即得到一个RST,ACK,所以我猜端口是关闭的,不管这个web服务器是什么,没有被设置。

关于这个问题的更多信息:800700c1 error from /trace:error

我试过了:

删除applicationhost。配置(和更改端口号) 以管理员身份运行visual studio 删除文档中的IISExpress文件夹(更改错误消息,直到文件夹重新安装) 切换SSL关闭和打开,复制url到启动框。(注意:我没有使用ssl) 清除所有SFC /scannow错误 从x86版本和64位版本启动iisexpress


当前回答

对我来说,当我在DOS提示符上添加ipllisten时,IIS Express是不可访问的:netsh http add ipllisten MyIPAddress。我通过删除iplisten MyIPAddress来修复它:netsh http delete iplisten MyIPAddress。

其他回答

只要以管理员身份运行visual studio就可以了。

对我来说很容易。

清洗溶液 重新构建解决方案。 运行Ctrl + F5(不调试运行)

如果你使用的是VS 2017或VS 2019。Net Core,你可以直接进入launchSettings。只需更改iisSetting的applicationUrl键的端口号。

我不会假装完全理解MS bug造成的这个问题,但这里有另一个潜在的解决方案:

在.vs/config/applicationHost. conf文件中。在config文件中,找到<system.applicationHost><applicationPools>。在这些池下,确保managedRuntimeVersion属性值与系统的IIS配置中的值(和/或已安装的. net框架的版本)匹配。

例如,你可能会发现(正如我所做的)生成的文件有:

    <add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />

在我的例子中,你可以用:

    <add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0.30319" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />

注意从“v4.0”到“v4.0.30319”的替换。这就解决了问题。


发生了什么:

我相信VS正在生成一个applicationHost。. net框架的“默认”版本,这可能与系统上安装/配置的特定版本不匹配。您可以通过跟踪Process Monitor中的执行来调试/观察这个问题,并找到iisexpress.exe的命令行。在添加/trace:error的情况下运行此命令,将得到一个关于预装版本为v4.0的CLR失败的信息更丰富的消息。即:

启动IIS Express… 尝试预加载CLR版本v4.0时失败。Hr = 80131700 W3WP_HOST hr = 80131700初始化失败 过程模型关闭称为 无法启动iisexpress。


不管怎样,我觉得这可能会对其他人有所帮助,因为在网上有多个含有坏信息的推荐信是很常见的,我个人现在已经碰到过几次了。

As Svenmarim already stated, this mostly occurs because the ip adress is already in use. This answer and its comments from the visualstudio developer community pointed me to the right direction. In my case i was trying to access my local IISExpress instance from my local network and therefore binded my ip adress with the same port which uses my IISExpress instance via netsh http add urlacl url=http://192.168.1.42:58938/ user=everyone After removing this binding via netsh http delete urlacl url=http://192.168.1.42:58938/ it worked again.