Debug .Net Core Application in Local Kubernetes Container with Azure Draft and VS code –Part - 1

Two different worlds talk to each other when we go for this topic of debugging dot net core based sample application which is basically a containerized application using VS code with help of Azure Draft.

The two different worlds :

Kubernetes - Black world of command prompt.

VS code – that colorful (blue tough) , UI.

This article shows how to combine these two different worlds to enable debugging your Dot net core based application.

This article will take you through step by step with following major section and sub sections :

  1. Install required tools and utilities :
    • Install docker for windows.
    • Install Minikube ( for Kubernetes ) on windows.
    • Install Kubectl , which is CLI for Kubernetes .
    • Install VS code.
    • Install Helm.
    • Install Azure Draft.
  2. Create Sample dot net core app in visual studio and setup draft.
  3. Debug the application using draft.

Basically what is going to be here is nothing new , the concept of debugging any remotely deployed application are going to apply here.

If we remember old days where we want to debug any product deployed application or any application at remote computer then we used to follow following steps :

  1. deploy application in Debug mode.
  2. have MSVSMON.exe available on remote computer up and running .
  3. connect to that remote computer from our local machine’s visual studio.
  4. attach the debugger to remote process.

Similar things will happen here once we go through all the steps , using draft here is what happens :

  1. deploy application in Debug mode in local minikube node as container application .
  2. have VSDBG package available on container (that will be done automatically once we setup sample application for draft DokerFile)
  3. connect to that container from VS code by using launch.json setting of VS code.
  4. attach the debugger to remote process that will be done once we hit the debug button using that specific launch setting.