关闭“语言服务已禁用". VS2017中的错误消息 [英] Turning off "Language Service Disabled" error message in VS2017
问题描述
我们在Visual Studio 2017 Enterprise的MVC Web应用程序中收到以下错误"消息.
We are getting the following "Error" message in our MVC web application in Visual studio 2017 Enterprise.
项目'C:\ Work \ Blackhawk的语言服务被禁用 Platform \ Platform-DEV-Branch \ BlackhawkViewer \ BlackhawkViewer.csproj' 因为它包含大量的.js文件.考虑排除 使用"tsconfig.json"文件的排除"部分.
The language service is disabled for project 'C:\Work\Blackhawk Platform\Platform-DEV-Branch\BlackhawkViewer\BlackhawkViewer.csproj' because it included a large number of .js files. Consider excluding files using the 'exclude' section of a 'tsconfig.json' file.
我尝试关闭选项中的语言服务,但这不会关闭消息:
I have tried turning off the Language service in the options but this does not turn the message off:
这是一个相当大的Web应用程序.有没有办法关闭此消息而又不禁用tsconfig.json文件中的任何文件?
This is a rather large web application. Is there a way to turn this message off without disabling any files in the tsconfig.json file as it suggests?
推荐答案
要解决此问题,请执行以下操作:
To solve this issue do the following:
- 在项目的根目录中创建文件,并将其命名为
tsconfig.json
- 添加此内容:
{
"compilerOptions": {
"allowJs": true,
"noEmit": true,
"module": "system",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true
},
"include": [
"scripts"
],
"exclude": [
],
"typeAcquisition": {
"enable": true
}
}
请查看以下两个tsconfig.json解释的链接,因为您可能仍需要根据您的设置对其进行更改.这是对我有用的唯一方法.希望对您有所帮助.
https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
https://developercommunity.visualstudio.com/content/problem/8148/javascript-intellisense-not-working.html
Please have a look at the below two links for tsconfig.json explanation, because you may still need to change it according to your setup. This is the only way that worked for me. I hope that will help.
https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
https://developercommunity.visualstudio.com/content/problem/8148/javascript-intellisense-not-working.html
这篇关于关闭“语言服务已禁用". VS2017中的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!