4

I have this idea to use Visual Studio Code as a debugger of a working .NET Framework application.

Let's assume that there is a running process that runs a full .NET Framework 64-bit application. I have all the PDBs. Would it be possible to attach to that process Visual Studio Code debugger and debug that process?

For now, I have tried, with C# extension from OmniSharp launch.json:

{
    "version": "0.2.0",
    "configurations": [
         {
             "name": "Attach to process",
             "type":"clr",
             "request": "attach",
             "processName": "process_name"
         }]
 }

but it ends with:

Unable to start debugging. Failed to attach to process: Unknown Error: 0x8013132e

Anyone mayby tried to achieve the same? Is this even possible? Maybe there is some other plugin that I have skipped?

Artur
  • 128
  • 10
  • Does this answer your question? [Visual Studio Code for .Net Framework](https://stackoverflow.com/questions/47707095/visual-studio-code-for-net-framework) – Martheen Nov 09 '20 at 08:52
  • Unfortunately, it does not answer my question. Provided solutions require to build the .NET Framework application inside VS Code. I just want to attach to an already running process without rebuilding the .NET full Framework in VS Code. – Artur Nov 09 '20 at 09:17
  • 1
    `0x8013132e` is [`CORDBG_E_DEBUGGER_ALREADY_ATTACHED`](https://github.com/dotnet/coreclr/blob/master/src/pal/prebuilt/inc/corerror.h#L166). Whether that's true or not is another matter, but it's a solid clue. – Jeroen Mostert Nov 09 '20 at 09:41
  • Thanks, that's a true statement. I was trying to attach the debugger in VS Code to a process that had already a debugger attached, but in (full) Visual Studio. Now the next step for me is to resolve: "WARNING: Could not load symbols for 'process_name.exe'. process_name.pdb' is a Windows PDB. These are not supported by the cross-platform .NET Core debugger." Of course, that exe was compiled with .pdb set as portable – Artur Nov 09 '20 at 11:47

0 Answers0