Timeout waiting for debug server to connect in VSCode when debugging embedded Python

Andrew Cunningham 21 Reputation points
2023-06-02T15:24:54.81+00:00

I am trying to 'locally" debug Python 3.8.10 embedded in my 64-bit Windows GUI application on Windows 10 with VSCode.
I know this works for many people - I want to what possibly I am doing wrong with how I am embedding python that is preventing the debugging from VSCode working. My approach to embedding the python interpreter seems pretty vanilla.

--- Starting attach to pid: 12720 ---

--- Connecting to 64 bits target (current process is: 64) ---

--- Injecting attach dll: attach_amd64.dll into pid: 12720 ---

Running executable to inject dll.

OpenProcess with pid: 12720

VirtualAllocEx in pid: 12720

WriteProcessMemory in pid: 12720

loadLibraryAddress: 12720

Waiting for LoadLibraryA to complete.

Ok, finished dll injection.

--- Injecting run code dll: run_code_on_dllmain_amd64.dll into pid: 12720 ---

Running executable to inject dll.

OpenProcess with pid: 12720

VirtualAllocEx in pid: 12720

WriteProcessMemory in pid: 12720

loadLibraryAddress: 12720

Waiting for LoadLibraryA to complete.

Ok, finished dll injection.
Attaching to PID: 12720 (elapsed: 11.11s).
Attaching to PID: 12720 (elapsed: 12.13s).
Attaching to PID: 12720 (elapsed: 13.13s).
Attaching to PID: 12720 (elapsed: 14.14s).
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,869 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 27,731 Reputation points Microsoft Vendor
    2023-06-05T07:03:51.3533333+00:00

    Hi @Andrew Cunningham,

    Welcome to Microsoft Q&A!

    You are using Visual Studio Code, which is different from Visual Studio. The tag “Visual Studio” is related to Visual Studio, for more questions about Visual Studio Code, you can post it to the Stack Overview tagged visual-studio-code forum or GitHub repository where you would get professional support for this product.

    Thanks for your understanding.

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful