Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

launch.json configuration needs targetArchitecture on arm64 macOS/Windows #3005

Open
gregg-miskelly opened this issue Nov 19, 2021 · 3 comments
Milestone

Comments

@gregg-miskelly
Copy link
Member

gregg-miskelly commented Nov 19, 2021

Hello, I work on the debugger that ships with the C# extension.

On arm64 macOS, the C# extension will default to debugging using the debugger that matches the machine architecture as long as an arm64 .NET runtime is installed. At least in the configuration used by dotnet/vscode-csharp#4900, Azure Functions will run in an x64 process, causing debugging to fail.

If Azure Functions always uses an x64 process, the following should be added to the template:

"targetArchitecture": "x86_64"

If the correct architecture is more complicated then that, hopefully a command can be used to query the Azure functions extension for the right architecture.

Note that the debugger will currently ignore targetArchitecture in scenarios where the debugger only installs one architecture. Which is currently the case for all platforms except for arm64 macOS, though it is possible that someday we could support this on Windows.

@ejizba
Copy link
Contributor

ejizba commented Nov 19, 2021

At the moment, the func cli only supports x64, but that will likely change going forward (Azure/azure-functions-core-tools#2834)

@gregg-miskelly
Copy link
Member Author

In that case I would probably suggest something like:

    "configurations": [
    {
      "name": "Attach to .NET Functions",
      "type": "coreclr",
      "request": "attach",
      "processId": "${command:azureFunctions.pickProcess}",
      "targetArchitecture": "${command:azureFunctions.targetArchitecture}"
     }
  ]

@hajekj
Copy link

hajekj commented Apr 5, 2023

I think that when we merge this PR (dotnet/vscode-csharp#5646) there should be no blocker to add this, and I will be happy to submit a PR. This will also enable a seamless workflow on both Mac and Windows ARM64 devices.

@gregg-miskelly gregg-miskelly changed the title launch.json configuration needs targetArchitecture on arm64 macOS launch.json configuration needs targetArchitecture on arm64 macOS/Windows Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants