Exposing Local ASP .NET Core Project to the Public Internet using Dev Tunnels

Juldhais Hengkyawan
2 min readMar 4, 2024

This article explains how to make our ASP.NET Core Web project on localhost accessible to the public internet, utilizing the Visual Studio DevTunnel. This tool offers a straightforward, cost-free, and integrated solution.

Create a new Tunnel

To create a new tunnel, click the down arrow next to the [Debug] button on the toolbar, select [Dev Tunnels], and then choose [Create a Tunnel…] from the menu.

Next, set the tunnel name. We can set it to the same name as the project to quickly identify it.

The tunnel type can be set to Temporary or Persistent. A temporary tunnel will use a new URL when Visual Studio is restarted. A persistent URL will reuse the same URL. Since I'm using Dev Tunnels to test the webhook and don't want to change the URL whenever Visual Studio is restarted, I choose Persistent for the tunnel type.

The access type can be set to Private, Organizational, or Public. I set the access type to Public because it needs to be accessed by an external system outside the organization.

Click [OK] to create a new Dev Tunnel.

Run the Project

Dev Tunnel will automatically start when we run the project. The browser window will appear; open the Dev Tunnel URL, and show the dialog below:

Click [Continue] to open the website.

Now, we can access our application from the public internet using the Dev Tunnel URL displayed in the browser.

The Dev Tunnel will automatically stop if we stop debugging in Visual Studio.

Thank you for reading 👍

--

--