Cov txheej txheem:

Kuv yuav siv debug code hauv Visual Studio li cas?
Kuv yuav siv debug code hauv Visual Studio li cas?

Video: Kuv yuav siv debug code hauv Visual Studio li cas?

Video: Kuv yuav siv debug code hauv Visual Studio li cas?
Video: Jupyter! Tracking Python Variables 2024, Hlis ntuj nqeg
Anonim

Thaum koj muaj koj lub launch configuration teeb, pib koj debug kev sib tham nrog F5. Xwb koj tuaj yeem khiav koj qhov kev teeb tsa los ntawm Command Palette (Ctrl + Ua haujlwm + P), los ntawm kev lim dej. Debug : Xaiv thiab Pib Kev debugging los yog ntaus ntawv ' debug ', thiab xaiv lub configuration koj xav tau debug.

Ib yam li ntawd, tib neeg nug, Kuv yuav ua li cas debug Python code hauv Visual Studio?

Xaiv cov cuab yeej> Xaiv cov ntawv qhia zaub mov hais kom ua, mus rau Python > Kev debugging , thiab xaiv qhov Use legacy debugger kev xaiv. Yog hais tias koj tau nruab ib tug laus version ntawm ptvsd nyob rau hauv lub tam sim no ib puag ncig (xws li ib tug ua ntej 4.0. x version, los yog ib tug 3. x version yuav tsum tau rau tej thaj chaw deb debugging ), Visual Studio tej zaum yuav qhia qhov yuam kev lossis ceeb toom.

Ib tug kuj yuav nug, dab tsi yog breakpoint nyob rau hauv code? Hauv kev txhim kho software, a breakpoint yog ib txwm txhob txwm nres lossis ncua qhov chaw hauv qhov kev zov me nyuam, muab tso rau hauv qhov chaw rau kev debugging lub hom phiaj. Nws kuj yog qee zaum tsuas yog hu ua kev ncua. Feem ntau, a breakpoint yog ib txoj hauv kev kom tau txais kev paub txog ib qho kev pab cuam thaum nws ua tiav.

Kuj Paub, Kuv yuav ua li cas debug. NET code hauv Visual Studio?

Tsim ib qhov project

  1. Qhib Visual Studio 2017.
  2. Los ntawm cov ntawv qhia zaub mov saum toj kawg nkaus, xaiv Cov Ntaub Ntawv> Tshiab> Qhov project.
  3. Hauv New Project dialog box nyob rau sab laug pane, nthuav C#, thiab tom qab ntawd xaiv. NET Core. Hauv nruab nrab pane, xaiv Console App (. NET Core). Tom qab ntawd npe qhov project get-started-debugging. Yog tias koj tsis pom Console App (.

Kuv yuav qhib vs JSON li cas hauv code?

Tsim ib tug tso tawm . json ntaub ntawv, qhib koj qhov project folder hauv VS Code (Cov ntaub ntawv> Qhib Folder) thiab tom qab ntawd xaiv Configure iav icon ntawm lub Debug saib saum bar. Yog tias koj rov qab mus rau File Explorer saib (Ctrl + Ua haujlwm + E), koj yuav pom qhov ntawd VS Code tau tsim ib. vscode folder thiab ntxiv rau tso tawm . json ua ntaub ntawv rau koj qhov chaw ua haujlwm.

Pom zoo: