Effortless Remote Debugging with Dev Tunnel in Visual Studio 2022
Tags: blazor, development, ui, visualstudio
Published: 2024-03-28 03:09:01

---
title: Effortless Remote Debugging with Dev Tunnel in Visual Studio 2022
published: true
date: 2024-03-20 17:47:49 UTC
tags: blazor, development, ui, visualstudio
canonical_url: https://www.syncfusion.com/blogs/post/dev-tunnel-remote-debug-vs-2022.aspx
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oic0nv329t3zh68o2ock.png
---

**TLDR:** Learn how Visual Studio 2022’s Dev Tunnel simplifies remote debugging, enhances collaboration, and streamlines workflows for developers.

Remote collaboration has become a crucial component of software development in today’s connected world. Debugging code remotely has become essential as teams dispersed across various locations and time zones. Dev Tunnel, a ground-breaking feature in [Visual Studio 2022](https://visualstudio.microsoft.com/vs/ "Visual Studio 2022"), provides seamless remote debugging capabilities.

In this blog, we’ll explore the power of [Dev Tunnel](https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/overview "What are dev tunnels") and how it enhances developers’ remote debugging experience.

## Understanding Dev Tunnel

Dev tunnel provides a secure way for developers to share local web services over the internet. They enable seamless integration between your local development environment and cloud services, facilitate collaboration by allowing you to share work in progress with colleagues, and assist in creating webhooks.

It’s important to note that dev tunnels are primarily intended for ad-hoc testing and development purposes and should not be used for production workloads.

In [Visual Studio 17.6 and later versions](https://learn.microsoft.com/en-us/aspnet/core/test/dev-tunnels?view=aspnetcore-7.0#create-a-tunnel "Learn how to use dev tunnels in Visual Studio 2022 with ASP.NET Core apps"), you can conveniently generate public or private persistent/temporary tunnels directly through the Visual Studio wizard; you will no longer need the extra configurations in your project.

This feature enables you to create a proxy to your local machine effortlessly, ensuring seamless connectivity. The tunnel remains active until you close it, enhancing the developer experience and streamlining your workflow.

**Note:** The feature is not currently available in Visual Studio for MacOS.

## Setting up Dev Tunnel with Syncfusion Blazor Data Grid application

Let’s see how to set up Dev Tunnel with [Syncfusion Blazor Data Grid](https://www.syncfusion.com/blazor-components/blazor-datagrid "Blazor DataGrid") by following these steps:

1. First, create your [Blazor server application](https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create "Get started with your first Blazor server application") using Visual Studio 2022.
2. Configure the [Syncfusion Blazor Data Grid](https://blazor.syncfusion.com/documentation/datagrid/getting-started "Getting started with Blazor DataGrid") within your application.
3. Create a new Dev Tunnel within Visual Studio by referring to the following image.  
 ![Create a new Dev Tunnel within Visual Studio](https://www.syncfusion.com/blogs/wp-content/uploads/2024/03/Create-a-new-Dev-Tunnel-within-Visual-Studio.png)
4. Now, select the account you want to use to create the tunnel. The available account types are [Azure](https://azure.microsoft.com/en-us/get-started/azure-portal "Microsoft Azure portal"), [Microsoft Account](https://account.microsoft.com/account "Microsoft Account"), and [GitHub](https://github.com/login "GitHub Account").  
 ![Select the account you want to use to create the tunnel](https://www.syncfusion.com/blogs/wp-content/uploads/2024/03/Select-the-account-you-want-to-use-to-create-the-tunnel.png)
  - Provide a name for the tunnel. This name is used to identify the tunnel in the Visual Studio UI.
  - Choose the tunnel type, **Persistent** or **Temporary**:
      - A temporary tunnel requires a new URL each time Visual Studio starts.
      - A persistent tunnel requires the same URL each time Visual Studio starts. For more details, refer to the [Persistent vs. Temporary Tunnels](https://learn.microsoft.com/en-us/aspnet/core/test/dev-tunnels?view=aspnetcore-7.0#persistent-versus-temporary-tunnels "Persistent versus temporary tunnels") article.
  - Choose any one of the following authentication types that are required to access the tunnel. 
      - **Private:** This tunnel can be accessed only by the account that created it.
      - **Organization:** This tunnel can be accessed by the accounts within the same organization as the one who created it. If we select this option for our personal Microsoft account (MSA), the effect will be the same as when choosing the private authentication type. This support isn’t available for GitHub accounts.
      - **Public:** Anyone can access this tunnel. It doesn’t require an authentication. But ensure the security of the web app or API, which are accessible to anyone online.
  - Click **OK** to create the Dev Tunnel. You will get the following pop-up window once the Dev tunnel is successfully created. ![Pop-up window notifying successful creation of Dev tunnel](https://www.syncfusion.com/blogs/wp-content/uploads/2024/03/Create-Dev-Tunnel-get-success-pop-up-1.png)
5. Run the application and obtain the tunnel URL from the browser, as shown below.```
https://gml6h4x7-7265.asse.devtunnels.ms/
```
6. Use the tunnel URL to run the app in the iPad Pro 12 Emulator or any desired environment. ![Run app with tunnel URL on iPad Pro 12 Emulator or any desired environment.](https://www.syncfusion.com/blogs/wp-content/uploads/2024/03/Run-app-with-tunnel-URL-on-iPad-Pro-12-Emulator-or-any-desired-environment.png)
7. Proceed with running the application.
8. Verify that the [Syncfusion Blazor Data Grid](https://blazor.syncfusion.com/documentation/datagrid/getting-started "Getting started with Blazor DataGrid") sample is rendered successfully. ![Verify successful rendering of Syncfusion Blazor DataGrid sample.](https://www.syncfusion.com/blogs/wp-content/uploads/2024/03/Verify-successful-rendering-of-Syncfusion-Blazor-DataGrid-sample.png)
9. Select a row within the Data Grid sample. ![Select a row within the Data Grid](https://www.syncfusion.com/blogs/wp-content/uploads/2024/03/Selecting-a-row-in-the-DataGrid-sample.png) The debugger will hit the specified breakpoint in the Data Grid [RowSelected event handler](https://blazor.syncfusion.com/documentation/datagrid/events#rowselected "RowSelected event handler"), allowing you to debug and analyze your code.  

<figure>

  <img src="https://www.syncfusion.com/blogs/wp-content/uploads/2024/03/Performing-remote-debugging-with-Dev-Tunnel-in-Blazor-DataGrid-app.png" alt="Performing remote debugging with Dev Tunnel in Blazor Data Grid app" style="width:100%">

  <figcaption>Performing remote debugging with Dev Tunnel in Blazor Data Grid app</figcaption>

</figure>

## Benefits of Dev Tunnels

- **Simplified remote debugging:** With Dev Tunnel, you no longer need to spend hours configuring complex network settings or dealing with firewalls and port forwarding. The streamlined process allows you to quickly establish a connection to your remote environment and start debugging immediately.
- **Secure connection:** Dev Tunnel leverages SSH tunneling. It provides a secure connection between your local machine and the remote environment. It helps us to ensure that the data remains encrypted and protected from unauthorized access.
- **Streamlined workflow:** Dev Tunnel integrates seamlessly into Visual Studio 2022, allowing you to utilize familiar debugging tools and features. You can set breakpoints, inspect variables, step through code, and use all the debugging capabilities as if working on your local machine.
- **Multiple scenarios:** Whether you’re debugging a cloud-based app, a microservice architecture, or a remote IoT device, Dev Tunnel can handle a wide range of scenarios. It enables you to debug apps in remote environments without any hassle.
- **Collaboration made easy:** Dev Tunnel empowers remote teams to collaborate effectively. Developers can work together on the same codebase, debugging and troubleshooting issues, regardless of their physical locations. This feature significantly improves productivity and teamwork.

## Conclusion

Thanks for reading! In this blog, we delved into the power of Dev Tunnel in Visual Studio 2022 and how it simplifies debugging apps in remote environments.

The Syncfusion [Blazor component](https://www.syncfusion.com/blazor-components "Blazor component") library offers responsive, lightweight components for building modern web apps.

Our existing customers can download the new version of Essential Studio from the [License and Downloads](https://www.syncfusion.com/account "Essential Studio License and Downloads page") page. If you are not a Syncfusion customer, try our 30-day [free trial](https://www.syncfusion.com/downloads "Get the free evaluation of the Essential Studio products") to check out our incredible features.

If you have any questions or need assistance, our support team is always here to help. Feel free to contact us through our [support forum](https://www.syncfusion.com/forums "Syncfusion Support Forum"), [support portal](https://support.syncfusion.com/ "Syncfusion Support Portal"), or [feedback portal](https://www.syncfusion.com/feedback/ "Syncfusion Feedback Portal"). We look forward to hearing from you!

## Related blogs

- [What’s New in Syncfusion Blazor: 2024 Volume 1](https://www.syncfusion.com/blogs/post/whats-new-blazor-2024-vol-1.aspx "Blog: What’s New in Syncfusion Blazor: 2024 Volume 1")
- [Create Responsive Web Designs Like a Pro with Blazor Media Query](https://www.syncfusion.com/blogs/post/responsive-web-blazor-mediaquery.aspx "Blog: Create Responsive Web Designs Like a Pro with Blazor Media Query")
- [Perform Effortless CRUD Actions in Blazor DataGrid with Fluxor](https://www.syncfusion.com/blogs/post/crud-blazor-datagrid-fluxor.aspx "Blog: Perform Effortless CRUD Actions in Blazor DataGrid with Fluxor")
- [Mastering State Maintenance in Blazor Tabs](https://www.syncfusion.com/blogs/post/state-maintenance-blazor-tabs.aspx "Blog: Mastering State Maintenance in Blazor Tabs")