I am new to ASP.NET and programming too. I am using Visual Studio 2022 v17.5 and ASP.NET Core 6 for building a web application.
I am in the development environment. Initially all was going well but suddenly it starting misbehaving by showing
Warning: Failed to determine the https port for redirect
The web page loads but doesn't respond to any click and browser reload animation also keeps on revolving.

I searched the internet but failed to find any fix. Please guide to fix this error and thanks in advance for any solution.
Here is an answer from MS Docs:
A port must be available for the middleware to redirect an insecure request to HTTPS. If no port is available:
Specify the HTTPS port using any of the following approaches:
Set HttpsRedirectionOptions.HttpsPort.
Set the https_port host setting:
In host configuration.
By setting the ASPNETCORE_HTTPS_PORT environment variable.
By adding a top-level entry in appsettings.json:
"https_port": 443,
Indicate a port with the secure scheme using the ASPNETCORE_URLS environment variable. The environment variable configures the server. The middleware indirectly discovers the HTTPS port via IServerAddressesFeature. This approach doesn't work in reverse proxy deployments.
The ASP.NET Core web templates set an HTTPS URL in
Properties/launchsettings.json for both Kestrel and IIS Express.
launchsettings.json is only used on the local machine.
Configure an HTTPS URL endpoint for a public-facing edge deployment
of Kestrel server or HTTP.sys server. Only one HTTPS port is used by
the app. The middleware discovers the port via
IServerAddressesFeature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With