Skip to content

Debugging Scripts with Visual Studio

Komefai edited this page Nov 13, 2017 · 5 revisions

How to debug your script with PS4 Macro

  1. Setup the project as mentioned in Scripting Basics.

  2. In project properties, go to Debug tab and select Start external program as your path to PS4Macro.exe in Start Action.

  3. Create settings.xml in the project's output folder (eg. MyScript/bin/Debug/) since PS4 Macro will now use the one next to your DLL instead of the default one next to the exe. In settings.xml, set StartupFile to the script DLL for convenience.

<?xml version="1.0" encoding="utf-8"?>
<Settings>
  <StartupFile>MyScript.dll</StartupFile>
  <ShowConsole>true</ShowConsole>
</Settings>
  1. Start the project as you would with an application project (pressing F5). Try adding a breakpoint and now it should be triggered.

NOTES

  • Use Console.WriteLine to print to the built-in console
  • Use System.Diagnostics.Debug.WriteLine to print to "Output" console in Visual Studio.