---
title: Debugging Remote/Containerized Apps with VS Code
description: Follow our step-by-step tutorial to debug a .NET Core application running inside a Kubernetes cluster by using Visual Studio Code's Pipe transport debug configuration.
image: https://blog.avenuecode.com/hubfs/esousa/start-debug.png
---

[AvenueCode.com](https://avenuecode.com) [News](https://avenuecode.com/news) [Contact](https://avenuecode.com/contact)

[![Avenue Code Snippets Logo](https://blog.avenuecode.com/hubfs/Avenue%20Code%20New%20Logos%20-%202023/AC-Snippets---Black.png)](https://blog.avenuecode.com/?hsLang=en-us) *menu*

- Technology
  
  [Cloud](https://blog.avenuecode.com/blog/topic/cloud?hsLang=en-us) [Delivery Infrastructure](https://blog.avenuecode.com/blog/topic/delivery-infrastructure?hsLang=en-us) [Web Experience](https://blog.avenuecode.com/blog/topic/web-experience?hsLang=en-us) [Agile Mindset](https://blog.avenuecode.com/blog/topic/agile-mindset?hsLang=en-us) [Quality First](https://blog.avenuecode.com/blog/topic/quality-first?hsLang=en-us)
  
  [Design](https://blog.avenuecode.com/blog/topic/design?hsLang=en-us) [Solution Architecture](https://blog.avenuecode.com/blog/topic/solution-architecture?hsLang=en-us) [Data & ML](https://blog.avenuecode.com/blog/topic/data-and-machine-learning?hsLang=en-us) [Mobile Experience](https://blog.avenuecode.com/blog/topic/mobile-experience?hsLang=en-us)
- [Whitepapers](https://blog.avenuecode.com/blog/topic/whitepapers?hsLang=en-us)
- [Spotlight](https://blog.avenuecode.com/blog/topic/spotlight?hsLang=en-us)
- [Extraordinary Women in Tech](https://blog.avenuecode.com/blog/topic/extraordinary-women-in-tech?hsLang=en-us)
- [Avenue Code Culture](https://blog.avenuecode.com/blog/topic/avenue-code-culture?hsLang=en-us)

- [Cloud](https://blog.avenuecode.com/blog/topic/cloud?hsLang=en-us)
- [Design](https://blog.avenuecode.com/blog/topic/design?hsLang=en-us)
- [Delivery Infrastructure](https://blog.avenuecode.com/blog/topic/delivery-infrastructure?hsLang=en-us)
- [Solution Architecture](https://blog.avenuecode.com/blog/topic/solution-architecture?hsLang=en-us)
- [Web Experience](https://blog.avenuecode.com/blog/topic/web-experience?hsLang=en-us)
- [Data & ML](https://blog.avenuecode.com/blog/topic/data-and-machine-learning?hsLang=en-us)
- [Agile Mindset](https://blog.avenuecode.com/blog/topic/agile-mindset?hsLang=en-us)
- [Mobile Experience](https://blog.avenuecode.com/blog/topic/mobile-experience?hsLang=en-us)
- [Quality First](https://blog.avenuecode.com/blog/topic/quality-first?hsLang=en-us)
- [Whitepapers](https://blog.avenuecode.com/blog/topic/whitepapers?hsLang=en-us)
- [Spotlight](https://blog.avenuecode.com/blog/topic/spotlight?hsLang=en-us)
- [Extraordinary Women in Tech](https://blog.avenuecode.com/blog/topic/extraordinary-women-in-tech?hsLang=en-us)
- [Avenue Code Culture](https://blog.avenuecode.com/blog/topic/avenue-code-culture?hsLang=en-us)

# [Debugging Remote/Containerized Apps with VS Code](https://blog.avenuecode.com/debugging-remote-containerized-apps-with-vs-code)

- [Tweet](https://twitter.com/share)

*perm\_identity* [Eduardo Sousa](https://blog.avenuecode.com/debugging-remote-containerized-apps-with-vs-code/author/eduardo-sousa?hsLang=en-us)

*schedule* 7/25/18 5:00 PM

[Visual Studio Code's](https://code.visualstudio.com) [Pipe transport](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/Debugger/gdb/PipeTransport.md) debug configuration makes debugging many non-standard configurations easy. In this article, I will demonstrate how to leverage this tool to debug a [.NET Core](https://github.com/dotnet/core) application running inside a [Kubernetes](https://kubernetes.io/) cluster.

***Note:** the following instructions assume that you already have [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) installed and properly configured.*

##### Container Requirements

Before we start debugging, we'll need to have both the debugger and the ps command available on the app's container. The .NET Core Linux installation script is available [here](https://aka.ms/getvsdbgsh). 

Assuming that the container was based on the 'microsoft/dotnet:2.0-runtime-deps' docker image, you will need to:

**1.** Gain access to the container, as follows:

```
$ kubectl exec -it your-pod-name bash
```

**2.** Once inside the container, execute:

```
$ apt update$ apt install -y curl unzip procps$ curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg
```

##### Setting up Visual Studio Code

On Visual Studio Code, we'll need to:

**1.** Install [C# plugin](https://github.com/OmniSharp/omnisharp-vscode)

**2.** Set up the `launch.json` configuration file. Put the following content in the `./vscode/launch.json` file (relative to your workspace):

```
{    "version": "0.2.0",    "configurations": [        {            "name": "Attach in k8s",            "type": "coreclr",            "request": "attach",            "processId": "${command:pickRemoteProcess}",            "justMyCode": false,            "pipeTransport": {                "pipeProgram": "kubectl",                "pipeArgs": [                    "exec",                    "-i",                    "your-pod-name",                    "--"                ],                "quoteArgs": false,                "debuggerPath": "/vsdbg/vsdbg"            },            "sourceFileMap": {                "/path/to/original/source/files": "${workspaceRoot}"            }        }    ]}
```

***Note 1:** The* `"justMyCode": false` *will only be required if your app was built with the release configuration. *`PDB` *files will always be required to exist on the pod.*

***Note 2:** Remember to replace* `your-pod-name` *by the name of your pod and* `/path/to/original/source/files` *by the path that was originally used to build your app.*

##### Let's Debug!

Now that we have everything set up, we can debug!

**1.** Select "Debug" from the side bar, then "Attach in k8s." Finally, click on the green arrow to the left of the drop-down menu.

![start-debug.png](https://blog.avenuecode.com/hubfs/esousa/start-debug.png)

**2.** After a while, VS Code will show you a list of running processes from which you can select your app.

![process-pick.png](https://blog.avenuecode.com/hubfs/esousa/process-pick.png)

***Note:** If you have published your app as a* **Self-Contained Application***, the* process ID* will likely be* `1`*. In this case, you can set the* `PID`* configuration to* `1` *so that you won't have to manually choose it every time.*

**3.** Debug!

After a while, you should see the VS Code debugger toolbar.

![debug-toolbar.png](https://blog.avenuecode.com/hubfs/esousa/debug-toolbar.png)

Now you're all set to place your breakpoint and debug your application:

![breakpoints.png](https://blog.avenuecode.com/hubfs/esousa/breakpoints.png)

##### Conclusion

This tutorial demonstrates one of Visual Studio Code's many debugger use cases. A similar approach can be employed in other scenarios like:

\* [Docker](https://www.docker.com/) containers

\* Remote app through **ssh**

\* Other technologies rather than **.NET Core**.

Check out more configuration details [here](https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes), and be sure to tell us how this technique works for you in the comments below!

---

[![Facebook Icon](https://blog.avenuecode.com/hubfs/Images/Blog/facebook.png)](https://www.facebook.com/eacsousa) [![LinkedIn Icon](https://blog.avenuecode.com/hubfs/Images/Blog/linkedin.png)](https://www.linkedin.com/in/ecsousa)

### Author

# Eduardo Sousa

 Eduardo Sousa is a Software Engineer at Avenue Code. He graduated with a degree in Computer Science from UFMG. His professional experience is focused on .NET technology, and he's always looking at the latest tech trends. Outside work, he is a video game fan, a bass player, and a heavy Vim user.

---

### Related Posts

### Asymmetric Cryptography

[READ MORE](https://blog.avenuecode.com/asymmetric-cryptography?hsLang=en-us)

### Improving the developer experience when documenting

[READ MORE](https://blog.avenuecode.com/improving-the-developer-experience?hsLang=en-us)

### How to Run Rust from Python

[READ MORE](https://blog.avenuecode.com/how-to-run-rust-from-python?hsLang=en-us)

### How to Create a Tic-Tac-Toe Board Using React.js

[READ MORE](https://blog.avenuecode.com/how-to-create-a-tic-tac-toe-board-using-react.js?hsLang=en-us)

### Leave a Comment!

### Avenue Code Social

[![Facebook Icon](https://blog.avenuecode.com/hubfs/Images/Blog/facebook.png?t=1486470796564)](https://www.facebook.com/avenuecode)

[![Twitter Icon](https://blog.avenuecode.com/hubfs/Images/Blog/twitter.png?t=1486470796842)](https://twitter.com/AvenueCode)

[![LinkedIn Icon](https://blog.avenuecode.com/hubfs/Images/Blog/linkedin.png?t=1486470796556)](https://www.linkedin.com/company/avenue-code)

### Newsletter

Want to stay on top of all tips and news from Avenue Code?

### Popular Snippets

![Primary Logo AvenueCode Inverted.png](https://blog.avenuecode.com/hs-fs/hubfs/Images/Logos/Primary%20Logo%20AvenueCode%20Inverted.png?width=1104&name=Primary%20Logo%20AvenueCode%20Inverted.png "Primary Logo AvenueCode Inverted.png")

### About Us

- [Who We Are](https://www.avenuecode.com/who-we-are)
- [What We Do](https://www.avenuecode.com/what-we-do)
- [Portfolio](https://www.avenuecode.com/portfolio)
- [Partners](https://www.avenuecode.com/partners)
- [News](https://www.avenuecode.com/news)
- [Events](https://www.avenuecode.com/events)
- [Blog](https://blog.avenuecode.com/)
- [Contact](https://www.avenuecode.com/contact)

### Our Offices

San Francisco

[+1 415 766 4178](tel:+553125161448) [ac.inquiries@avenuecode.com](mailto:brazil.info@avenuecode.com)

Belo Horizonte

[+55 31 2516 1448](tel:+553125161448) [brazil.info@avenuecode.com](mailto:brazil.info@avenuecode.com)

São Paulo

[+55 11 3205 3232](tel:+553125161448) [brazil.info@avenuecode.com](mailto:brazil.info@avenuecode.com)

### We're Hiring!

- [Belo Horizonte](https://www.avenuecode.com/who-we-are)
- [New York](https://www.avenuecode.com/what-we-do)
- [San Francisco](https://www.avenuecode.com/portfolio)
- [São Paulo](https://www.avenuecode.com/partners)

---

©2015 - 2017 Avenue Code

[![Facebook Icon](https://blog.avenuecode.com/hubfs/Images/Icons/facebook-2.png)](https://www.facebook.com/avenuecode) [![Twitter Icon](https://blog.avenuecode.com/hubfs/Images/Icons/twitter-2.png)](https://twitter.com/AvenueCode) [![LinkedIn Icon](https://blog.avenuecode.com/hubfs/Images/Icons/linkedin-2.png)](https://www.linkedin.com/company/avenue-code) [![Glassdoor Icon](https://blog.avenuecode.com/hubfs/Images/Icons/glassdoor-icon-1.png)](https://www.glassdoor.com/Overview/Working-at-Avenue-Code-EI_IE456173.11,22.htm) [![YouTube Icon](https://blog.avenuecode.com/hubfs/Images/Icons/youtube-2.png)](https://www.youtube.com/user/AvenueCodePlay)

Please enable JavaScript to view the [comments powered by Disqus.](http://disqus.com/?ref_noscript)

© 2026 Avenue Code

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Eduardo Sousa",
    "url" : "https://blog.avenuecode.com/author/eduardo-sousa"
  },
  "datePublished" : "2018-07-25T20:00:00.000Z",
  "headline" : "Debugging Remote/Containerized Apps with VS Code",
  "image" : [ "https://blog.avenuecode.com/hubfs/esousa/start-debug.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.avenuecode.com/debugging-remote-containerized-apps-with-vs-code",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.avenuecode.com/hubfs/Avenue%20Code%20New%20Logos%20-%202023/Avenue%20Code-primary%20versions_LOGO%20HORIZONTAL%20group%201-7.png"
    },
    "name" : "Avenue Code"
  }
}
```