Turning off “Language Service Disabled” error mess

2020-02-08 06:50发布

We are getting the following "Error" message in our MVC web application in Visual studio 2017 Enterprise.

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:

enter image description here

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?

9条回答
冷血范
2楼-- · 2020-02-08 07:34

I have found a solution for this problem.

I reset my userData using:

devenv.exe /resetuserdata

Since doing this the JavaScript settings seem to have persisted and I no longer get the language service error above.

TAKE NOTE: This will reset all your user data and customisations.

查看更多
够拽才男人
3楼-- · 2020-02-08 07:34

I solved this problem with following solution:

When you have a JavaScript file that is included in the project.csproj file but isn't in the project folder, this error occurred.

For example I have a .csproj file like below:

 <ItemGroup>
     <Content Include="Scripts\Test.js" />
 </ItemGroup>

The Test.js is included in the .csproj file, but it isn't in the Scripts folder:

Delete the <Content Include="Scripts\Test.js" /> line from the .csproj file and rebuild your project

查看更多
叛逆
4楼-- · 2020-02-08 07:34

If none of suggested methods worked, try:

npm install -g typescript@latest

and then

Install the lastest version of TypeScript for Visual Studio on Get TypeScript.

Hope this helps...

查看更多
登录 后发表回答