dev-tunnels
dev-tunnels copied to clipboard
Asp.net with Angular dev tunnel returns 404
A project created in a template asp.net with angular. Dev tunnel creates only one port. When the SPA project is ready it is redirected to the new port. Normally here the angular app would show up. However after redirected, it returns 404 error 'page can't be found'. When I check dev tunnel, there is only one port, which is the initial while SPA is not ready yet.
Hi @gitHubUser151 - Can you add more details outlining your scenario and the expected behavior here? How many ports are you expecting to be there on the tunnel? Also, if you have the tunnel id available, along with a timestamp, we can take a look at our telemetry.
Sure, I'm here to help while using ngrok))
Here is the normal behavior without dev tunnel:
-
On F5 the local host starts on port 7245:
-
Once SPA proxy is ready, it automatically redirected to port 44476. And the app works from this new port as usual:
Now will do the same with dev tunnel.
-
First port 7245 gets launched:
-
Once the SPA proxy is ready, it gets redirected to port 44476:
We can see that there is only one channel was created for port 7245. And this is the problem.
Time of launch is 12:53 PM Turkey time zone, 13 November. Not sure how to retrieve the timestamp.
Dev Tunnels during test: https://localhost:7245 -> https://zhhxnj80-7245.euw.devtunnels.ms/ https://localhost:7245 -> https://8rflcxbs-7245.euw.devtunnels.ms/ https://localhost:7245 -> https://vf30p0jx-7245.euw.devtunnels.ms/
Let me know if any more is required
Thanks for the details. Port 44476 can be added via the "Dev Tunnels" pane in VS. This would allow that port to also be made available on the tunnel.
Sure, could you please send some screenshots on how to add the port to the tunnel? I could not find how to do it. Therefore created this issue.
In the Tools Window, there should be a "+" button. I believe that should allow you to add a port. https://learn.microsoft.com/en-us/aspnet/core/test/dev-tunnels?view=aspnetcore-8.0#dev-tunnels-tool-window
Derek, Thanks for the answer. The '+' button adds a new dev tunnel, not a port. Currently I don't see the way to add a new port to existing tunnel, nor assign a specific port to a new dev tunnel.
Another option is to use the devtunnel CLI to host both ports simultaneously. Documentation on hosting is available at https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/cli-commands#host-a-dev-tunnel