每次我尝试调试我的 asp.net 网站时,我都会收到此错误:
无法启动 IIS Express Web 服务器。
无法为站点“SociopackWebAPI”应用程序“/”注册 URL“ http://localhost:50010 /”。错误描述:进程无法访问该文件,因为它正被另一个进程使用。(0x80070020)
在事件查看器中,我在日志中注意到了这个错误:
应用程序池“Clr4IntegratedAppPool”、PID='13248' 的工作进程在被要求开始处理 http 请求时未能初始化 http.sys 通信,因此将被 W3SVC 视为有问题并终止。数据字段包含错误编号。
我认为这意味着我的 Clr4IntegratedAppPool 没有足够的权限?我该如何解决这个问题?
IIS Express 无法正常启动的原因之一可能是它要使用的端口被保留。如果您要使用的端口netstat -an | findstr <your port number>未在使用中,则不会显示在其中。
您可以更改您使用的端口或删除保留。
查看预订(提升的命令提示符): netsh int ipv4 show excludedportrange protocol=tcp
Protocol tcp Port Exclusion Ranges
Start Port End Port
---------- --------
80 80
443 443
50000 50059 *
* - Administered port exclusions.
Run Code Online (Sandbox Code Playgroud)
如果保留范围未与 一起使用,您可以将其删除netsh int ipv4 delete excludedportrange protocol=tcp startport=50000 numberofports=60。应该回复Ok.如果你得到Access denied.它是因为范围当前正在使用中。您必须关闭使用端口的程序才能创建与范围相交的预留。
如果要再次创建范围,请使用netsh int ipv4 add excludedportrange protocol=tcp startport=50000 numberofports=60.
我遇到了这个问题,因为我最近安装了 Hyper-V 和 Docker,而我的 IIS Express 在我的事件日志中抛出了 ID 为 2269 的错误事件:
The worker process for app pool 'Clr4IntegratedAppPool', PID='12345', failed to initialize the http.sys communication when asked to start processing http requests and therefore will be considered ill by W3SVC and terminated. The data field contains the error number.
随后是 2276:
The worker process failed to initialize correctly and therefore could not be started. The data is the error.
我的解决方案来源:Docker for Windows – Port Reservations | 开发者沉思
小智 3
我在 VS2017 / IIS Express 10 中遇到了完全相同的问题。尝试了在论坛上找到的一些提示和技巧,但真正真正解决该错误的唯一方法如下:
| 归档时间: |
|
| 查看次数: |
5554 次 |
| 最近记录: |