如何使用Visual Studio社区调试vbscript(2019) [英] How to debug vbscript with Visual Studio Community (2019)

查看:99
本文介绍了如何使用Visual Studio社区调试vbscript(2019)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找到一个免费的解决方案来调试vbscripts,我尝试使用Visual Studio 2019 Community Edition.我只用一个附加组件(即时调试器)进行了非常基本的安装.我以管理员身份执行以下所有步骤.

我使用以下非常简单的脚本创建了文件 Script2.vbs :

  a = 1b = 1/0c = 1 

我启动了命令行(cmd.exe),然后输入了 cscript.exe/x"C:\ ... \ Script2.vbs

该脚本已执行,并按预期在第2行失败,但是

问题在于即时调试器无法启动.

(我希望在

还请注意,如果我尝试从Visual Studio社区启动脚本,则菜单调试">开始调试"将显示为灰色:

我的主要问题是:

Visual Studio 社区版是否关闭了调试脚本的功能?

(这导致了第二个问题:是否有一种免费调试VBS脚本的解决方案?)

解决方案

如果您仍然感兴趣,可以使用一种方法来修复Visual Studio社区.可能是缺少一些先决条件.因此,您需要修改"安装的选件并找到脚本"单个组件设置中的调试选项.

例如,这是我最少的组件集.

I'd like to find a free solution to debug vbscripts, and I tried Visual Studio 2019 Community Edition. I did the very basic installation with only one additional component, the Just-In-Time debugger. I ran all the following steps as administrator.

I have created the file Script2.vbs with this very simple script:

a=1
b=1/0
c=1

I started the command line (cmd.exe) and entered cscript.exe /x "C:\...\Script2.vbs

The script is executed and fails as expected at line 2 but

the problem is that the Just-In-Time debugger doesn't start.

(I expect the popup which is below "The Visual Studio Just-In-Time Debugger window appears" in this Microsoft article)

I have found in this question about the previous version of the Community Edition that there should be the option "Script", but I don't have it:

Note also that if I try to start the script from Visual Studio Community, the menu Debug > Start debugging is grayed out:

My main question is:

Is the feature of debugging scripts turned off with Visual Studio Community Edition?

(which leads to the second question: is there a solution to debug VBS scripts for free?)

解决方案

If you are still interested, there is a way to fix Visual Studio Community. It's likely some missing pre-requisites. Therefore you need to "Modify" the installed options and find "Script" debugging options in the Individual Components setup.

For example this is my minimum set of components.

这篇关于如何使用Visual Studio社区调试vbscript(2019)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆