简体   繁体   English

Visual Studio 2017中不支持某些项目类型的Javascript

[英]No Javascript support in Visual Studio 2017 for some project types

When I create a new ASP.NET Core Web Application in VS 2017, I get great Javascript support, eg Intellisense and formatting. 当我在VS 2017中创建新的ASP.NET Core Web应用程序时,我获得了强大的Javascript支持,例如Intellisense和格式。 On the top of the file are three dropdowns indicating the scope of where the cursor is in the project. 文件顶部是三个下拉菜单,指示光标在项目中的位置范围。

When I open a Javascript file in one of my older projects, eg when I open a local website directly, I get none of this Javascript support. 当我在较旧的项目之一中打开Javascript文件时(例如,当我直接打开本地网站时),我没有此Javascript支持。 The three dropdowns are empty and the only thing I really get is code coloring. 这三个下拉列表是空的,我唯一真正得到的就是代码着色。 I am opening the file using the same VS default Javascript editor. 我使用相同的VS默认Javascript编辑器打开文件。

Any reasons why the Javascript support would only work in some project types? 为什么对Javascript支持只能在某些项目类型中起作用?

The problem was not about the project type, but instead that I used 问题不在于项目类型,而是我所使用的

/// <reference path = "path-to-scriptfile" />

statements in some javascript files. 一些javascript文件中的语句。 I think, VS 2017 does not support those statements anymore and using them ruined my JS support, which somehow even infected other files in the project that did not have such references. 我认为,VS 2017不再支持这些语句,使用它们破坏了我的JS支持,这甚至以某种方式感染了项目中没有此类引用的其他文件。

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

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