简体   繁体   English

使用Sublime Text 3运行Scriptcs时出错

[英]Error on running Scriptcs with Sublime Text 3

I have installed Scriptcs to Sublime Text 3. 我已经将Scriptcs安装到Sublime Text 3。
I get this error when I press CTRL B and build my aspx page. 当我按下CTRL B并构建我的aspx页面时出现此错误。

'scriptcs' is not recognized as an internal or external command, operable program or batch file. 'scriptcs'不被识别为内部或外部命令,可操作程序或批处理文件。

I'm trying to run my aspx page on Sublime. 我正在尝试在Sublime上运行我的aspx页面。
How can I fix this ? 我怎样才能解决这个问题 ? Thanks. 谢谢。

You need to add scriptcs to you PATH environmental variable, otherwise the system cannot find the executable. 您需要向您添加scriptcs PATH环境变量,否则系统无法找到可执行文件。

The process is described in the ScriptCS documentation : ScriptCS文档中描述了该过程:

For simplicity, we will be using the Chocolatey Nuget method of installation. 为简单起见,我们将使用Chocolatey Nuget安装方法。 Copy and paste the following command into your console. 将以下命令复制并粘贴到控制台中。 This will execute a PowerShell script that will download Chocolatey, place it on your local drive, and configure your path. 这将执行PowerShell脚本,该脚本将下载Chocolatey,将其放在本地驱动器上,并配置您的路径。 Make sure to reload your session so your new path is loaded. 确保重新加载会话以便加载新路径。

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\\chocolatey\\bin

Next execute the following command in your console. 接下来在控制台中执行以下命令。 This will download ScriptCS, place it on your local drive, and configure your path. 这将下载ScriptCS,将其放在本地驱动器上,并配置您的路径。 Make sure to reload your session again so your new path is loaded. 确保再次重新加载会话,以便加载新路径。

cinst scriptcs

If you prefer adding scriptcs to your PATH manually (or simply want to get a better general understanding of PATH ), have a look at this excellent answer . 如果您希望手动将scriptcs添加到PATH (或者只是想更好地了解PATH ),请看一下这个优秀的答案

Please try installing SublimeREPL and then select scriptcs from the available options. 请尝试安装SublimeREPL ,然后从可用选项中选择scriptcs Once selected, try building the using ctrl+alt+B . 选择后,尝试使用ctrl+alt+B构建。 https://sublimerepl.readthedocs.io/en/latest/ https://sublimerepl.readthedocs.io/en/latest/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM