Debugging scripts with Visual Studio

This guide is written using Microsoft Visual Studio 2010 Shell (Integrated) with Python tools for Visual Studio. Both are free.

ComicRack setup

First configure ComicRack to use Visual Studio debugging. Open the ComicRack.ini file located in your installation directory.

Find the line:

; PythonDebug = false

and change it to:

PythonDebug = true

Alternatively create a ComicRack.ini file in %PROGRAMDATA%\cyo\comicrack or %APPDATA%\cyo\comicrack with the line:

PythonDebug = true

This has the advantage of not being reset every time a new version of ComicRack is installed.

Visual Studio setup

Open Visual Studio 2010 and open the script file you would like to debug:

i55.tinypic.com_14w9cmp.jpg

Add a breakpoint wherever you would like the script to pause by clicking on the grey bar to the left of the editor. A red circle will appear signifying the breakpoint:

i54.tinypic.com_1huqmp.jpg

Once you have all the breakpoints you want click Tools→Attach to Process. Select ComicRack.exe and click Attach:

i52.tinypic.com_1zr1ag2.jpg

Visual studio is now in debug mode.

Debugging

Switch to ComicRack and run the script as normal.

When the script reaches a breakpoint the script will pause and ComicRack will switch to Visual Studio:

i51.tinypic.com_nq2yrs.jpg

From here you can advance the script using the Debug Toolbar (1) and inspect the current variables (2).


Navigation