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:


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:


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


Visual studio is now in debug mode.


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:


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