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).
Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.