dotnet / dotnet/website-feedback

Blazor Tutorial Project attempts to use reserved port

Open
#16 5 comments 0 reactions 1 assignee Claimed by @mairaw View on GitHub
area-tutorials area-website tutorial-blazor
Dominant language
No language data
Stars
7
Forks
57
PR merge metrics
No merged PRs in 30d

Description

Problem encountered on https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/run#
Operating System: windows

I was getting the following error when running `dotnet watch run`:

`Unable to bind to http://localhost:5000 on the IPv4 loopback interface: 'An attempt was made to access a socket in a way forbidden by its access permissions.'.`

I found this SO reply: https://superuser.com/a/1504618

Running the listed command (`netsh interface ipv4 show excludedportrange protocol=tcp`) yielded several ranges which happened to overlap with port 5000. Changing the port in `launchSettings.json` allowed the watch command to run as expected.

The specific ranges seems to be different for every system that runs that command.

If there a way to free up these ports locally so that the tutorial can be run without modification? Alternatively, could the tutorial be changed to use a port that is not going to be reserved by Windows?

Some additional important, but less relevant questions:
Are there port ranges that are guaranteed NOT to be reserved at random by Windows?
Is the set of reserved port ranges meant to differ between systems? If so, why, and how does it pick the ranges?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.