I'm trying to get GitHub Codespaces working with a simple asp.net core web app.
I've created a new asp.net core web app (dotnet new webapp
), confirmed it all works locally, and then added it to an Organization GitHub repo.
From here, I open the repo in Codespaces, in the browser.
I've configured the container for C# and Sql, my docker files are unchanged from the ones that are generated.
I can build fine, then I dotnet run
from the Terminal and I can see the app starts up fine:
Info: Microsoft.Hosting.Lifetime[0]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]```
I also get a message about port forwarding, and I can see that port forward set up:
However, when I try that URL, I get an NGINX 502 Bad Gateway
error from the 5001 port. From the 5000 port URL it just tries to redirect me to https://localhost:5001
.
Am I missing some part of setup?
Things I've tried
- Adding
forwardedPorts
to thedevcontainer.json
file. - Toggling the port forward to public / private
- Changing the Port Protocol to https
- Logging in and out of github, and rebuilding the devcontainer many times.