Search code examples
c#windowslocalhostport

Change the port of a Process(WIn11)


For my Coding project I need my application running on localhost:5000 since everything else was set up around that. After starting my backend it said the address is already in use, which I checked: Errormessage

So I checked for the port being used and thats the case - Showing Port user

Since this is a Windows service that has something to do with my graphics driver, I would prefer not to terminate the task, but simply move it to another open port (e.g. 5500), permanently if possible.

Does anyone know what to do here? Many thanks in advance

I tried looking it up but nothing really helped!


Solution

  • I had a similar problem at work with that same app, the solution is in this link provided by provegard

    The service is just a .NET application and can be configured with the --urls parameter.

    Here's what I did:

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

    In step 4, choose another port if you like, and don't forget the space before --urls.