vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Simplify name of attach to process command

Open richlander opened this issue 1 year ago • 9 comments

There should be no place where we say ".NET 5+ or .NET Core" in the Devkit UI. It's both because all the .NET Core versions are EOL but also because this phrasing is just unnecessary and confusing. It's also makes us look a bit silly.

image

richlander avatar May 25 '24 16:05 richlander

The reasoning behind this naming is for the following:

  • This action does not support attaching to a .NET Framework process, however the C# extension supports a debugger that supports debugging .NET Framework that produces portable PDBs.
  • Although .NET Core is EOL, users may have projects still referencing it and the debugger has the capability of debugging them.
  • This follows the same pattern we use in Visual Studio's Attach to Process image

Let me know if we still should change the naming to just say Debug: Attach to a .NET process.

cc: @gregg-miskelly @hharshada @poppastring

WardenGnaw avatar May 27 '24 18:05 WardenGnaw

I think we should change it.

This comes down to a tradeoff:

  • Use 100% accurate terms, or
  • Use directly practical terms for most users

I'm in camp 2. We can rely on docs to explain support.

richlander avatar May 28 '24 03:05 richlander

I forget what failure looks like if you try and attach to a .NET Framework process. As long as we have some sort of reasonable failure message, I think it is okay to change it.

gregg-miskelly avatar May 28 '24 17:05 gregg-miskelly

@gregg-miskelly This is the current error message: Failed to attach to process: The .NET Debugger can only attach to x64 processes.

image

WardenGnaw avatar May 28 '24 18:05 WardenGnaw

Can you try with an x64 .NET Framework process instead?

gregg-miskelly avatar May 28 '24 18:05 gregg-miskelly

C:\Users>corflags.exe C:\Users\source\repos\FrameworkConsoleApp\FrameworkConsoleApp\bin\Debug\FrameworkConsoleApp.exe Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.8.3928.0 Copyright (c) Microsoft Corporation. All rights reserved.

Version : v4.0.30319 CLR Header: 2.5 PE : PE32+ CorFlags : 0x1 ILONLY : 1 32BITREQ : 0 32BITPREF : 0 Signed : 0

It just hangs without any error message, it seems to be stuck:

-> (C) {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"coreclr","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true},"type":"request","seq":1}
-> (C) {"command":"attach","arguments":{"name":".NET Core Attach","type":"coreclr","request":"attach","hotReloadOnSave":true,"hotReloadVerbosity":"minimal","stopAtEntry":false,"justMyCode":false,"requireExactSource":true,"enableStepFiltering":true,"logging":{"exceptions":true,"moduleLoad":true,"programOutput":true,"browserStdOut":true,"elapsedTiming":false,"threadExit":false,"processExit":true,"engineLogging":false,"diagnosticsLog":{"protocolMessages":false,"dispatcherMessages":"none","debugEngineAPITracing":"none","debugRuntimeEventTracing":false,"expressionEvaluationTracing":false,"startDebuggingTracing":false},"consoleUsageMessage":true},"suppressJITOptimizations":false,"symbolOptions":{"searchPaths":[],"searchMicrosoftSymbolServer":false,"searchNuGetOrgSymbolServer":false,"cachePath":"","moduleFilter":{"mode":"loadAllButExcluded","excludedModules":[],"includedModules":[],"includeSymbolsNextToModules":true,"includeSymbolsOnDemand":true}},"expressionEvaluationOptions":{"allowImplicitFuncEval":true,"allowToString":true,"allowFastEvaluate":true,"showRawValues":false},"processId":"2844","__sessionId":"1e2fe790-9f67-4994-9a9a-708f977b3c30"},"type":"request","seq":2}
ServiceBroker Start: 0 : Requesting proxy to "Microsoft.VisualStudio.Debugger.ManagedEditAndContinueRemoteDebuggerService (0.1)"
------------------------------------------------------------------------------
You may only use the Microsoft Visual Studio .NET/C/C++ Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you
develop and test your applications.
------------------------------------------------------------------------------
<- (R) {"seq":5,"type":"response","request_seq":2,"success":true,"command":"attach"}
<- (E) {"seq":6,"type":"event","event":"initialized","body":{}}
ServiceBroker Transfer: 0 : Transfer, relatedActivityId=d6809421-a302-4b27-ad78-673cc1afa589
ServiceBroker Start: 0 : Requesting pipe to "Microsoft.VisualStudio.Server.IBrokeredServiceBridgeManifest (0.1)"
ServiceBroker Stop: 0 : Requesting pipe to "Microsoft.VisualStudio.Server.IBrokeredServiceBridgeManifest (0.1)"
ServiceBroker Transfer: 0 : Transfer, relatedActivityId=f9a4a365-671f-4ea3-bb2a-99a7d4e2294d
ServiceBroker Stop: 0 : Requesting proxy to "Microsoft.VisualStudio.Debugger.ManagedEditAndContinueRemoteDebuggerService (0.1)"
-> (C) {"command":"setBreakpoints","arguments":{"source":{"name":"Program.cs","path":"c:\\Users\\\\source\\repos\\FrameworkConsoleApp\\FrameworkConsoleApp\\Program.cs","checksums":[{"algorithm":"SHA1","checksum":"de7e6b5d2408edb31fa0fd4e9c4b973964e325df"},{"algorithm":"SHA256","checksum":"5aa018b9b9afffb85dbead58716943d198a51a80624b7e501cce84496767bc1e"},{"algorithm":"SHA1","checksum":"31927ba8fb4d394c599e43c9dc549181d4026c7b"},{"algorithm":"SHA256","checksum":"a40a151d4a978306ff0826d8932f7d1dad42d77baf069b09d055f2d2daa9647c"}]},"lines":[15],"breakpoints":[{"line":15}],"sourceModified":false},"type":"request","seq":3}
-> (C) {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
-> (C) {"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[{"filterId":"user-unhandled"}]},"type":"request","seq":5}
<- (E) {"seq":7,"type":"event","event":"output","body":{"category":"telemetry","output":"vs/diagnostics/debugger/vsdbg/BreakpointAdded","data":{"VS.Diagnostics.Debugger.vsdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.vsdbg.Version":"17.11.10506.2 commit:bf05b28f55d97d1bcb78f61365a1efbfdf0eb128","VS.Diagnostics.Debugger.vsdbg.BreakpointAdded.HasHitCount":false,"VS.Diagnostics.Debugger.vsdbg.WindowsVersion":"10.0.22631","VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.BreakpointAdded.BreakpointType":"Source","VS.Diagnostics.Debugger.vsdbg.BreakpointAdded.HasLogMessage":false,"VS.Diagnostics.Debugger.vsdbg.BreakpointAdded.HasCondition":false}}}
<- (R) {"seq":8,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":false,"message":"The breakpoint is pending and will be resolved when debugging starts.","line":15}]}}
<- (R) {"seq":9,"type":"response","request_seq":4,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
<- (R) {"seq":10,"type":"response","request_seq":5,"success":true,"command":"setExceptionBreakpoints","body":{"breakpoints":[{"verified":true}]}}
-> (C) {"command":"configurationDone","type":"request","seq":6}
<- (E) {"seq":11,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/ProcessCreate","data":{"VS.Diagnostics.Debugger.vsdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.vsdbg.Version":"17.11.10506.2 commit:bf05b28f55d97d1bcb78f61365a1efbfdf0eb128","VS.Diagnostics.Debugger.vsdbg.WindowsVersion":"10.0.22631","VS.Diagnostics.Debugger.vsdbg.TargetArchitecture":"AMD64"}}}
<- (E) {"seq":12,"type":"event","event":"process","body":{"name":"C:\\Users\\\\source\\repos\\FrameworkConsoleApp\\FrameworkConsoleApp\\bin\\Debug\\FrameworkConsoleApp.exe","systemProcessId":2844,"isLocalProcess":true,"startMethod":"attach"}}
ServiceBroker Start: 0 : Requesting proxy to "Microsoft.VisualStudio.Debugger.ManagedEditAndContinueCsDevKitEngineService (0.1)"
<- (R) {"seq":13,"type":"response","request_seq":6,"success":true,"command":"configurationDone"}
<- (E) {"seq":14,"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":false,"message":"No symbols have been loaded for this document.","line":15}}}
ServiceBroker Stop: 0 : Requesting proxy to "Microsoft.VisualStudio.Debugger.ManagedEditAndContinueCsDevKitEngineService (0.1)"
-> (C) {"command":"threads","type":"request","seq":7}
<- (R) {"seq":15,"type":"response","request_seq":7,"success":true,"command":"threads","body":{"threads":[]}}

WardenGnaw avatar May 28 '24 18:05 WardenGnaw

Thanks. That is what I was afraid of. I personally think because of this we shouldn't name it "Debug: Attach to a .NET process" as there is almost no feedback what is wrong if you attach to a .NET Framework process.

@richlander What do you think of "Debug: Attach to a .NET (6+) process"?

gregg-miskelly avatar May 28 '24 18:05 gregg-miskelly

Is there no way to detect and fail so we can call it .NET?

davidfowl avatar May 30 '24 14:05 davidfowl

I don't think we would want to error out in that case, since it is possible to host both .NET Framework and coreclr in the same process (not that this is a good idea). But we could warn I suppose.

gregg-miskelly avatar May 30 '24 15:05 gregg-miskelly