GordianDotNet / VSMonoDebugger

Enables Visual Studio 2017 to deploy and debug a mono application on remote linux machines via SSH.
MIT License
49 stars 25 forks source link

Debugging cannot be started. #37

Open hunter1974 opened 8 months ago

hunter1974 commented 8 months ago

Hello @GordianDotNet I have the following problem.

Windows 11 Pro Visual Studio 17.9.5 VSMonoDebugger2022 2.2209.1806

After start "Deploy, Rund and Debug" I get the following message:

[VSMonoDebugger] Debugging cannot be started. An error has occurred, which usually indicates a faulty installation (code 0x80020154).

I have repaired Visual Studio and even a new installation did not help.

[VSMonoDebugger-Log] 2024-04-03 09:25:49.6001|TRACE|VSMonoDebugger.Debuggers.SSHDebuggerBase|Entering: DeployRunAndDebugAsync - SSHDebuggerBase.cs(24) 2024-04-03 09:25:49.6001|TRACE|VSMonoDebugger.Debuggers.SSHDebuggerBase|Entering: StartDebuggerAsync - SSHDebuggerBase.cs(45) 2024-04-03 09:25:49.6001|TRACE|VSMonoDebugger.MonoVisualStudioExtension|Entering: AttachMonoDebuggerToRunningProcess - MonoVisualStudioExtension.cs(369) 2024-04-03 09:25:49.6001|INFO|VSMonoDebugger.Debuggers.SSHDebuggerBase|StartDebuggerAsync - deploy 2024-04-03 09:25:49.8036|ERROR|VSMonoDebugger.MonoVisualStudioExtension|Catched: AttachMonoDebuggerToRunningProcess - MonoVisualStudioExtension.cs(393)|System.Runtime.InteropServices.COMException (0x89710015): Debugging cannot be started.

On my notebook everything works without problems, I also use Visual Studio 17.9.5 and VSMonoDebugger 2..2209.1806.

Thank you.

hykhang126 commented 6 months ago

Hello, I've had the same issue on my Visual Studio 17.9.7. But if I downgrade my Visual studio to 17.3.4 it appears to work normally. So maybe the extension is not well supported for higher version of VS?

BoggyDG commented 4 months ago

The specific thing causing the error is int hr = dbg.LaunchDebugTargets(1, pInfo) @ MonoVisualStudioExtension.cs(line 388). It returns an invalid code, which then makes Marshal.ThrowExceptionFromHR(hr) on the next line throw an exception. I tried fixing this issue myself but unfortunately got nowhere. The exact error code seems to be REGDB_E_CLASSNOTREG, where a COM class wasn't registered, possibly due to the debugger updating and changing some things?

On another note, any other debuggers that people use that work? I've tried half a dozen different approaches and none have worked. I would really like to be able to debug my code but alas, nothing.