'VS Code can't catch breakpoint in unity3D

Generally, when I want to debug, I just need to set breakpoint, run debug in VSCode and then get in Play Mode in Unity3D, if it captures any break point, the Unity3D will pause and navigate to the breakpoints in VSCode. But recently, I can't do it anymore.

This problem occurs in both unity ver 2019 and 2020, I think the problem is not about my editor but my VSCode and some configuraton, but don't know how to solve it. When I run the debug in VSCode, it still attached Unity3D in the debug console, have searched some tips on google but not address the problem. Even if I create a new project but it's still not work. Thanks so much for any tips.

This is my launch.json file

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    {
        "name": "Unity Editor",
        "type": "unity",
        "path": "/D:/WecoApp/WecoAppLocal/Library/EditorInstance.json",
        "request": "launch"
    },
    {
        "name": "Windows Player",
        "type": "unity",
        "request": "launch"
    },
    {
        "name": "OSX Player",
        "type": "unity",
        "request": "launch"
    },
    {
        "name": "Linux Player",
        "type": "unity",
        "request": "launch"
    },
    {
        "name": "iOS Player",
        "type": "unity",
        "request": "launch"
    },
    {
        "name": "Android Player",
        "type": "unity",
        "request": "launch"
    },
    {
        "name": "Xbox One Player",
        "type": "unity",
        "request": "launch"
    },
    {
        "name": "PS4 Player",
        "type": "unity",
        "request": "launch"
    },
    {
        "name": "SwitchPlayer",
        "type": "unity",
        "request": "launch"
    }
]

}



Solution 1:[1]

This answer is related to the same problem for Ubuntu 20.04 LTS environment.

After the configuration, you have done to VSCode, (more details about the configuration are mentioned here How do I use Visual Studio Code to develop Unity3D projects in Ubuntu) you have to restart your machine. This step is not mentioned.

Solution 2:[2]

Make sure vs-code is the default external script editor in Unity. go to Edit>Preferences>External Tools and select vs-code. the the External Script Editor Args box just below should automatically change

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Rumba