1

jsc, the JScript compiler for .Net Framework, has a /debug option.

The suggested debugger, dbgclr.exe, is not available anymore. Do you know of any currently available debugger to step through JScript code?

Just to avoid misunderstanding, I am speaking of the Microsoft JScript, which is able to access Windows API, its file system, Office etc; not the JavaScript that comes with the browser.

2 Answers 2

3
  1. Compile your code with debugger symbol on. For example [jsc /debug+ test.js]
  2. Insert [System.Diagnostics.Debugger.Launch();] into your code where you want to break(debugger).
  3. Make sure you install C# development tool on your Visual Studio 2019/2017.
  4. Go to your Visual Studio 2019/2017's menu Tools>Options>Debugging>Just-in-time, check Managed.
  5. Run the .exe file. In this example, it will be test.exe.
  6. You should see a JIT debugger popup.
Sign up to request clarification or add additional context in comments.

1 Comment

Don't forget to [import System;].
-1

When you execute your JScript using the command line, you can do it with cscript and the debug option. You will be asked which debugger you want to use, and you can attach visual studio to it. Example (in the command line, after launching cmd.exe):

cscript.exe "path to your JScript.js" //X  <==(the //X turns on the debugger)

After running this, there will be a popup that asks which debugger you want to use. You can either open a new instance of Visual Studio, or if you're working with the JScript in Visual Studio already, you can use an existing instance.

This works for Visual Studio Express as well.

1 Comment

This is a question about .net, not JScript you run through WSH.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.