更改进程的端口(WIn11)

问题描述 投票:0回答:1

对于我的编码项目,我需要我的应用程序在 localhost:5000 上运行,因为其他所有内容都是围绕它设置的。启动我的后端后,它说该地址已在使用中,我检查了:Errormessage

所以我检查了正在使用的端口,情况就是这样 - Showing Port user

由于这是一项与我的图形驱动程序有关的Windows服务,我不想终止该任务,而只是将其移动到另一个开放端口(例如5500),如果可能的话永久移动。

有人知道在这里可以做什么吗?非常感谢提前

我尝试查找它,但没有任何帮助!

c# windows localhost port
1个回答
0
投票

我在使用同一个应用程序时遇到了类似的问题,它来自英特尔的驱动程序,解决方案在此链接中

community.intel.com/t5/Graphics/OneApp-IGCC-WinService-using-port-5000/m-p/1543661#M124733

该服务只是一个 .NET 应用程序,可以使用 --urls 参数进行配置。

这就是我所做的:

Open the Registry Editor (as always, be careful in there).
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\igccservice.
Double-click the ImagePath key.
Append after the quotes: --urls http://127.0.0.1:50000
Click OK.
Restart the service.

在第 4 步中,如果您愿意,可以选择另一个端口,并且不要忘记 --urls 之前的空格。

© www.soinside.com 2019 - 2024. All rights reserved.