Debugging C# Scripts Using Visual Studio Code
Mastercam makes an extension available so that developers who write C# scripts in Microsoft Visual Studio Code can also debug Mastercam in Visual Studio Code.
-
Complete the tasks in this topic to install the extension and configure Mastercam to support it.
-
Additional tasks are required to configure the extension. See the documentation included with the extension.
There are two ways to install the extension.
-
Browse or search for the Mastercam NET-Scripting extension from Microsoft’s Visual Studio marketplace and click Install.
-
If the .vsix file has already been downloaded onto your system, you can install from the vsix file. Click the Extensions icon then Views and More Actions (the “…” button) and select Install from VSIX.
The name of the file is mc-net-scripting-x.y.nn.vsix, where x.y.nn is the version number of the extension.
Before you can debug scripts inside Mastercam, you need to configure Mastercam so that the necessary support DLL is loaded when Mastercam starts. This lets the debugger and Mastercam communicate with each other.
-
Select File, Configuration.
-
Go to the Start/Exit page.
-
Select the Startup option.
-
Click the folder button and navigate to the \chooks\MCNetScripting folder. This is located in the folder where Mastercam is installed. The default location is:
\Program Files\Mastercam 2023\Mastercam\chooks\MCNetScripting
-
Select IPCServer.dll.
-
Save the .config file.
This procedure modifies the .config file for your default units (inch or metric). If you wish, complete these steps again for the .config file that supports the other units.





