我更改了启动设置以支持远程ip主机
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://192.168.1.69:55446/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"myapplication": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}它在我的系统中运行良好。
然后,我从另一个远程系统上的tfs下载我的项目,并更改ip地址以支持远程ip托管,并在管理员mode..but中运行应用程序,但仍显示"Unable to connect webserver 'IIS Express'“
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://192.168.1.79:55446/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"eBMSForumApplication": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}发布于 2021-01-20 15:34:41
如果您在输出控制台中看到类似以下内容:
IIS Express starting...
iis express Failed to register URL "http://localhost:61367/" for site application "/".
Error description: The process cannot access the file because it is being used by
another process该错误是由于您正在使用的端口造成的。
打开控制台,并使用以下命令查看使用的端口范围:
netsh interface ipv4 show excludedportrange protocol=tcp它看起来像这样:

更改要使用的端口号,该端口号不在这些范围内。
发布于 2021-08-04 23:45:11
这个问题类似于https://stackoverflow.com/a/67990888/733760,可能与Hyper-v保留了一堆端口范围有关。
如果这就是问题所在,同样的答案也适用(并且适用于我)。以管理员身份运行:
net stop winnat
net start winnat发布于 2021-03-26 17:16:25
在我的例子中,我从项目属性中取消选中了debug中的"Enable SSL“,并运行了项目。它弹出了一个iis,上面写着这个端口正在被chrome使用。所以我关闭了chrome的所有实例,并再次切换到“启用SSL”,它解决了我的问题。
https://stackoverflow.com/questions/41039668
复制相似问题