runtime: Debugger doesn't attach on macOS 26

Trying to test simple apps on macOS 26, with VS Code Insiders and C#DK (all latest).

------------------------------------------------------------------------------
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.
------------------------------------------------------------------------------
Hello, World!
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
The program '[12023] test' has exited with code 0 (0x0).

I am seeing this error. It happens with both .NET 9 and .NET 10 latest. It was not happening on Sequoia.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 16
  • Comments: 22 (14 by maintainers)

Most upvoted comments

I think this might be related to:

@Description: Calls to sem_open or sem_unlink from a process signed with a Team ID entitlement no longer observe any semaphores created by processes signed with different Team IDs. Named semaphores are now scoped to a single development team. (123476459)

I have the same problem on Rider when updating macOS 26; even though there is a process in debug, I can’t attach debug

This procedure may help you in the meantime. Though I’m not quite sure if restarts are necessary. Some people have found it helpful.

@lateralusX, Hey!

JFYI I contacted Apple developer support on that matter a few days ago and asked if this is an intended behavior on MacOS 26 (in the MacOS release notes they haven’t mentioned the change, only in iOS & iPadOS notes). And if so, if it is possible to make an exception for apps signed with debugger entitlement). I will post a comment here once I receive an answer.

Hope it helps!

I fixed it by this launch.json @richlander

I’m using a script. I have to run it each time the extension updates. I’m on insiders (VS Code and extensions) so that happens more often for me.

https://gist.github.com/richlander/89abaf1b25bc8796e7a88e9bf9c79d89

Note: The script needs a one line (obvious; line 7) update if you are using regular VS Code.

I have the same problem on Rider when updating macOS 26; even though there is a process in debug, I can’t attach debug

This procedure may help you in the meantime. Though I’m not quite sure if restarts are necessary. Some people have found it helpful.

Tks @markadrake very help full

To be transparent with our plan for this issue, @lateralusX is going to look into what we can do from the runtime side at the beginning of July. If we push any fixes, we anticipate having plenty of time working them through before MacOS 26 goes RTM.

Thank you @eterekhin.

Not a resolution in general, but on the VS Code side, this is resolvable in the C# DevKit pre-release by checking ‘Use Test Signed SDK’ and ‘Use Legacy Dotnet Resolution’. The fix coming out will make it work with only checking ‘Use Test Signed SDK’ which is a hidden setting only discoverable by the vscode setting search.

@hoyosjs, Thank you for pointing that out! I got debugger working after codesign --force -s - /path/to/debugger, same way as dotnet sdk does for executables

I am curious if we may want to work it around in diagnostics? As an example, we could create another child process from dbgshim that would manage the semaphores and signals to dbgshim via pipes. (I tried creating a semaphore between fork and execv from CreateProcessForLaunch, but that didn’t work, runtime was not able to find the semaphore) That’s an alternative to having debuggers unsigned

Can confirm, running under debugger doesn’t work. Even though attach is working

Debugger sequentially calls CreateProcessForLaunch(bSuspendProcess=1), RegisterForRuntimeStartup, ResumeProcess. After RegisterForRuntimeStartup call m_startupSem is successfully created here After ResumeProcess runtime can’t open semStartup semaphore in PAL_NotifyRuntimeStarted, for some reason it is considered to not exist (please see logs attached below)

In logs(stripped) it looks so:

PAL_RuntimeStartupHelper.Register creating startup '/clrst00004d9300000000684a8863' continue '/clrco00004d9300000000684a8863'
PAL's StartupHelperThread starting
IsCoreClrProcessReady: stat(/var/folders/6s/88nfy3mj1mj3sdkp_nhlffdr0000gp/T/clr-debug-pipe-19859-1749715043-in) FAILED: errno is 2 (No such file or directory)
sem_wait(startup)
// here runtime part starts
PAL_NotifyRuntimeStarted opening continue '/clrco00004d9300000000684a8863' startup '/clrst00004d9300000000684a8863'
sem_open(/clrst00004d9300000000684a8863) failed: 2 (No such file or directory)

Hope it helps!