VSCode 构建不起作用 - 未定义构建任务.在tasks.json 文件中用'isBuildCommand' 标记一个任务 [英] VSCode build not working - No build task defined. Mark a task with 'isBuildCommand' in the tasks.json file
问题描述
我全新安装了 VSCode,以及这个小巧的基本 TypeScript 应用程序.
I have fresh install of VSCode, and this tiny basic TypeScript app.
第一次,当我想构建应用程序时,VScode 需要生成tasks.json.
First time, when I want to build the app, VScode needs to generate tasks.json.
它很久以前就奏效了.
今天收到一条奇怪的消息
Today I am getting this weird message
未定义构建任务.在tasks.json 文件中用'isBuildCommand' 标记一个任务.
No build task defined. Mark a task with 'isBuildCommand' in the tasks.json file.
我不记得以前看过这条消息.
I don't remember seeing this message before.
但是,好的,我单击配置构建任务,选择 TypeScript 任务,然后生成了 tasks.json.
But, OK, I click Configure Build Task, select TypeScript task, and tasks.json gets generated.
但是,在我现在尝试构建之后,Ctrl+Shift+B 会发生什么,我再次收到完全相同的消息
But, what happens, after I try to build now, Ctrl+Shift+B, and I get the exact same message again
有什么想法吗?谢谢.
顺便说一句,将此设置添加到 tasks.json 并不能解决问题.
BTW, adding this setting to tasks.json doesnt solve the problem.
推荐答案
这里也解决了这个问题:https://github.com/Microsoft/vscode/issues/24796
This issue was also adressed here: https://github.com/Microsoft/vscode/issues/24796
它说:
关闭并重新打开窗口(不启动代码)可解决此问题.
Closing and reopening the window (without starting Code) resolves this issue.
这篇关于VSCode 构建不起作用 - 未定义构建任务.在tasks.json 文件中用'isBuildCommand' 标记一个任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!