Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 debugging vbscript

I'd like to debug a vbscript with Visual Studio 2017 Community Edition and followed the steps mentioned here for VS2015:

Video

I entered

cscript.exe /x foo.vbs

in the commandline, but no debugger starts. Is there a problem with the 2017th version of VS or are there some steps (e.g. configuration steps in VS) which are not shown in the video?

Edit: I tried cscript.exe //X foo.vbs , cscript.exe foo.vbs //X , cscript.exe //X //D foo.vbs and cscript.exe foo.vbs //X //D too

Thanks steff

like image 713
steff123 Avatar asked May 28 '17 10:05

steff123


2 Answers

Neither of those solutions worked for me. Found a workaround on MSDN

  1. Start Visual Studio.
  2. File -> Open Project.
  3. Point it at "C:\Windows\system32\cscript.exe" (or wherever your windows install directory is).
  4. When you get the elevation permissions dialog, click 'Ignore'.
  5. Go to project properties on the cscript.exe node.
  6. In arguments add '//d '.
  7. In 'Debugger type' change it to script.
  8. Close project properties.
  9. Hit F10.
like image 138
Niederee Avatar answered Nov 12 '22 03:11

Niederee


Please run your VS2017 as the admin, and then enable the script option under TOOLS->Options->Debugging->Just-In-Time, and then re-debug it again.

enter image description here

Even if I didn't use the VS2017 community version, but I get the same issue, I found that it was related to the JIT debugging in my side using VS2017 Enterprise version and it works well after I enable it:

enter image description here

like image 43
Jack Zhai-MSFT Avatar answered Nov 12 '22 03:11

Jack Zhai-MSFT