找不到任务运行器配置? [英] No task runner configurations are found?
问题描述
我已经(刚刚安装)Visual Studio Professional 2017(V 15.9.4),一个
I have (freshly installed) Visual Studio Professional 2017 (V 15.9.4), a Visual Studio solution with with multiple projects, a single .sln
file and package.json
s of the projects in the respective project folders exampleCoorp.API
, exampleCoorp.UI
, etc. The frontend project is written in React, the others in C#.
当我导航到视图>其他Windows> Task Runner Explorer (最初由Mads Kristens移交给他人时,请参见 NPM Task Runner 也是
When I navigate to View > Other Windows > Task Runner Explorer (originally devolved by Mads Kristens, see marketplace.visualstudio.com). Since we also have a React part, I have the extension NPM Task Runner installed as well.
预计我会发生以下情况(我的队友截屏,我遵循了他们的项目设置说明):
I am expected something like the following (screenshot from my team mates whose project-setup instruction I followed):
但是,对我而言,实际结果却有所不同:
However, the actual result for me looks different:
我必须理解的错误来自显示的Visual Studio面板:
The error I have to understand comes from the shown Visual Studio panel:
未找到任务运行程序配置.
No task runner configurations are found.
但是为什么呢?更重要的是,我该如何解决?有解决方法吗?
There is only a single google-hit [developercommunity.visualstudio.com] which claims that the (only?) cause could be a misplaced package.json
file:
这两个问题都是由于Visual Studio的NPM集成不支持子文件夹而不是项目根目录中的package.json文件而引起的.微软自己的官方Angular项目模板要求将package.json放在/ClientApp子文件夹中,这不会改变.
Both problems are caused by the fact that Visual Studio’s NPM integration does not support a package.json file that is in a subfolder instead of the project root. Microsoft’s own official Angular project template requires that the package.json be placed in the /ClientApp subfolder, which is not something that is going to change.
这显然不是我的问题.任何帮助提示表示赞赏!
This is clearly not my issue here. Any help hint is appreciated!
推荐答案
在执行以下步骤(无特定顺序)之后,Task Runner Explorer最终可以正常工作:
The Task Runner Explorer eventually works as it should after I performed the following steps (in no specific order):
-
我将两个子项目标记为启动项目,其中一个子文件夹的子文件夹(本质上是该子项目的根文件夹)中有一个
package.json
.
我(重新)安装了 NPM任务运行器然后重新启动Visual Studio.
I (re-)installed the NPM Task Runner and restarted Visual Studio afterwards.
我的同事还建议重新启动计算机,但是我不确定这是否有必要.
My colleagues suggested also to reboot of the machine, but I am not sure that this was necessary.
这篇关于找不到任务运行器配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!