You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dschenkelman edited this page Apr 4, 2013
·
2 revisions
scriptcs Debugging overview
This document explains by example the steps required to use Visual Studio to debug .csx files that are executed with scriptcs. Hopefully you won't need to debug very often, but if you are in need be sure to follow this example.
Prerequisites
The following example shows how you can debug the WebApiHost sample. This procedure assumes that you have the .csx, packages.config and Packages folder already setup.
You must have the Roslyn CTP installed to get VS to recognize .csx files.
Steps
Open Visual Studio.
Open the Open Project dialog by navigating to File -> Open -> Project/Solution.
The resulting solution explorer should look like this:
Right-click the scriptcs solution item and click Properties.
Provide values for the following fields:
Arguments: server.csx -debug
Working directory: the source folder of the app you want to debug, in this the directory where server.csx is located.
Close the Properties window and save the solution.
Add server.csx to the solution by right-clicking the solution and selecting Add Existing Item.
Set a breakpoint in the return "Hello World"; line of the TestController.
Press F5.
Open any browser and navigate to localhost:8080/api/test.
That's it, the breakpoint will be hit. You have all the goodness of VS, such as the Immediate Window, Add Watch to help you debugging.