Debugging Method 1: Debug a .csx file
- Last UpdatedSep 11, 2025
- 1 minute read
You must have Visual Studio installed to use this method.
Debug a .csx file
-
Make sure the ScriptHost process is not running.
-
Launch a new session of Visual Studio and select Open project or Solution.
-
Instead of pointing to an .sln file, point to the ScriptHost.exe file in the bin folder.
Visual Studio opens and you should see ScriptHost listed as a project in the Solution Explorer.
-
From the File, Open menu, open the .csx file that you want to debug, and then set a breakpoint.
-
On the Debug menu, select Start Debugging.
-
Invoke the script by using the rts command, such as rts run basicsample.
Your script runs from within Visual Studio's debugger, and the breakpoint hits when it encounters the line.