Skip to content

Problem with the VS Code Stop Debugging API  #140560

@SuseeJeeva

Description

@SuseeJeeva

Hi all,

My objective is to create a VS Code Extension which can ATTACH debugger to a running .NET Console Application

I have a .NET Console Application running parallelly (The Console Application was not attached to the Visual Studio Debugger)

And I have created a VS Code Extension. (Used the default "Hello World" Extension)

In the Extension, I had the below code:

// Attach the debugger --- This is working as per the expectation
vscode.debug.startDebugging(undefined, {
		name: ".NET Core Attach",
		type: "coreclr",
		request: "attach", // Please note that the request is ATTACH
		processId: "18876" // Manually configured the Console Application's process ID
}, undefined);


// This is a dummy timer which waits for 5 secs
setTimeout(() => {
	//This piece of code is stopping the debugger BUT ALSO TERMINATE MY CONSOLE APPLICATION which is not expected
	vscode.debug.stopDebugging();

	//I have tried the below code as well, but no luck
	//vscode.debug.stopDebugging(vscode.debug.activeDebugSession);

}, 5000)

I am not sure why the vscode.debug.stopDebugging() API terminates the Console Application (Since the Debug Configuration request is ATTACH (but not LAUNCH)

Please help me understand what I am doing wrong here.

Thanks in Advance,
Susee

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions