How can I disable problems for virtual files in VSCode?

Viewed 600

I am working on a .Net Core application and I keep running into this problem where I get all sorts of random issues appearing in the Problems window in VSCode for "__virtual" files. There are no problems in the actual razor page (.cshtml) and everything is working how we would expect. Is there a way in VSCode to mass ignore all problems from __virtual files?

Problems in __virtual file

1 Answers

This started to happen to me after the latest update of Visual Studio Code.

My solution was to configure file association for .razor__virtual.html files into text

  1. Open visual studio code
  2. Click Settings icon in the left bottom and click Settings
  3. In the search box, search for Files: Associations (Copy-paste this)
  4. Click [Add Item] button and enter **/*.razor__virtual.html for key, text for value.

It should look like this, Files Associations VS Code

Done!

Related