Search code examples
visual-studiowarningssuppress-warnings

How do you suppress this warning in VS: "The type of schema applied to the document is not supported"


This morning I created an MSTest project in C#, and for one of the JSON resources, Visual Studio is showing this warning:

The type of schema applied to the document is not supported

However there's no option available in the tooltip that allows you to suppress it. So then I started looking for a specific code or something to look for in the project settings; however Microsoft's apparently full list of compiler warnings doesn't list this one, for whatever reason. Since this is a test project, I could probably just suppress all warnings across the board and be fine, but that's still not ideal.

Is there a way to suppress this one surgically, ideally in a way that applies throughout the project?


Solution

  • Apparently all you have to do is to close out the file. It seems to only show when the file is opened.

    Perhaps a later version of Visual Studio can make this warning behave more consistently with a standard warning in VS. Really it behaves very much like a refactoring / code cleanup suggestion (which commonly has a grey, squiggly line), rather than an actual warning. It's like it's just been mislabeled in development or whatever. However the good thing is that as long as the file is closed, it doesn't pollute the build or the errors window with warning messages.