Debugging a .NET extension using Visual Studio Code
Debugging in Visual Studio Code is configured using launch.json, where the executable program and its launch parameters are specified. This launch.json is already present in the examples from our GitVerse repository:
program: "C:/Program Files/Sprut Technology/SprutCAM 18/Bin64/sc.exe";args: ["/EXTENSION_DEBUG_FOLDER="${workspaceFolder}/project/main/bin/Debug""].
This means that selecting Run -> Start Debugging will lead to:
- Visual Studio Code executes preLaunchTask:
- Compiles your project, placing the DLL in the path specified in the .csproj file (
<OutDir>bin\$(Configuration)\</OutDir>); - Copies
settings.jsonto the same folder;
- Compiles your project, placing the DLL in the path specified in the .csproj file (
- C:/Program Files/Sprut Technology/SprutCAM 18/Bin64/sc.exe is launched with the parameter
/EXTENSION_DEBUG_FOLDER="${workspaceFolder}/project/main/bin/Debug"; - SprutCAM, in addition to the extensions already registered, analyzes the directory
${workspaceFolder}/project/main/bin/Debug, loading just compileddllfile according to thesettings.jsonfile; - Your breakpoints in Visual Studio Code will be hit as your extension is used in the SprutCAM application.