From 388b65689648301c2bf33a4185aea5687907d864 Mon Sep 17 00:00:00 2001 From: Vikash Agrawal Date: Fri, 24 May 2024 12:21:16 -0700 Subject: [PATCH] fix(csharpSamDebug): remove debug mode for arm64 #4934 Problem: When `sam local` is invoked for `cSharp`, the invocation gets blocked when trying to attach a debugger. `vsdbg` is not supported for `arm64` architecture. Solution: Disable `debug` mode for cases when the template architecture is `arm64` or the developer is using `arm64` architecture machines, for eg - Apple M1/M2/M3 chips. --- packages/core/src/shared/sam/debugger/csharpSamDebug.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/shared/sam/debugger/csharpSamDebug.ts b/packages/core/src/shared/sam/debugger/csharpSamDebug.ts index 06a04b08db..0c73cc830f 100644 --- a/packages/core/src/shared/sam/debugger/csharpSamDebug.ts +++ b/packages/core/src/shared/sam/debugger/csharpSamDebug.ts @@ -77,9 +77,10 @@ export async function invokeCsharpLambda(ctx: ExtContext, config: SamLaunchReque config.samLocalInvokeCommand = new DefaultSamLocalInvokeCommand([waitForDebuggerMessages.DOTNET]) // eslint-disable-next-line @typescript-eslint/unbound-method config.onWillAttachDebugger = waitForPort + const platformArchitecture = os.arch() if (!config.noDebug) { - if (config.architecture === 'arm64') { + if ([config.architecture, platformArchitecture].includes('arm64')) { void vscode.window.showWarningMessage( localize( 'AWS.sam.noArm.dotnet.debug',