Disable warnings for specific files in Visual Studio

Dominik Palo

I have some files in my C# WPF project with Build Action set to Content. But these files don't contain C# code. Unfortunatelly, these files generates a lot of Warnings in Error List. How can I set these non-c# files to be ignored in "VS Warnig Analyzer"? I tried use Exclude from StyleCop, but warnings are still here...

EDIT: Example warnings (there is 1623 warnings for single .pak file)

Warning 498 Attribute ' C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41526   1   SlidesDrive.Windows
Warning 514 Attribute ' C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41472   17  SlidesDrive.Windows
Warning 538 Attribute ' C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41224   1   SlidesDrive.Windows
Warning 548 Attribute ' C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41194   1   SlidesDrive.Windows
Warning 549 Attribute ' C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41196   1   SlidesDrive.Windows
Warning 126 Attribute '�' already exists.   C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41208   1   SlidesDrive.Windows
Warning 132 Attribute '�' already exists.   C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41213   1071    SlidesDrive.Windows
Warning 210 Attribute '�' already exists.   C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41911   1   SlidesDrive.Windows
Warning 211 Attribute '�' already exists.   C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41912   87  SlidesDrive.Windows
Warning 222 Attribute '�' already exists.   C:\Users\Dominik\Projects\slidessync\SlidesSync\SlidesSync\cef.pak  41925   1   SlidesDrive.Windows
Patrick Hofman

It seems to me these files are XML files, or another file type that Visual Studio recognizes. Visual Studio tries to check them if you open them (they don't have a compile time impact on warnings / errors). You can close them and the warnings will be gone.

You should probably:

  • Fix the issues if you can: double attributes are a bad idea. Use elements instead.
  • For XML: Add the XSD to Visual Studio to let Visual Studio correctly validate the XML file.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to disable Warnings of Visual Studio 2012?

From Dev

Enable/disable warnings, visual studio comand prompt

From Dev

Why disable specific warning not working in Visual Studio

From Dev

Why disable specific warning not working in Visual Studio

From Dev

Disable TypeScript files auto discovery in Visual Studio

From Dev

Is it possible to disable specific compiler warnings?

From Dev

Is it possible to disable specific compiler warnings?

From Dev

How to disable Ecmascript 6 linting warnings in Visual Studio Code RC5?

From Dev

Showing code Warnings in Visual Studio

From Dev

Visual Studio 2015 Warnings not triggered

From Dev

Auto disable specific extension when launch visual studio?

From Dev

Disable disclosure triangle next to files in Visual Studio Solution Explorer

From Dev

How to disable MSI logging files presumably being generated by Visual Studio

From Dev

Disable automatic commit of changed files in Visual Studio 2013 to git

From Dev

Disable disclosure triangle next to files in Visual Studio Solution Explorer

From Dev

Temporarily disable warnings on specific versions of GCC

From Dev

Disable specific warnings in Stack build --pedantic

From Dev

Disable bitcode with Visual Studio

From Dev

Disable bitcode with Visual Studio

From Dev

How to search within specific folders and files in Visual Studio 2010

From Dev

Visual Studio 2013 / Open all files of a specific extension

From Dev

How to generate Unreal Visual Studio solution files into specific folders

From Dev

Visual Studio 2013 Compiler Warnings not Showing

From Dev

Visual Studio 2013 not displaying unreferenced variable warnings

From Dev

Enable Mismatch namespace warnings in Visual Studio 2010

From Dev

How to suppress JSLint warnings in Visual Studio 2015

From Dev

Disable python warnings only for specific module via commandline

From Dev

Disable all warnings for specific file with premake5

From Java

Disable peek in Visual Studio Code

Related Related

  1. 1

    How to disable Warnings of Visual Studio 2012?

  2. 2

    Enable/disable warnings, visual studio comand prompt

  3. 3

    Why disable specific warning not working in Visual Studio

  4. 4

    Why disable specific warning not working in Visual Studio

  5. 5

    Disable TypeScript files auto discovery in Visual Studio

  6. 6

    Is it possible to disable specific compiler warnings?

  7. 7

    Is it possible to disable specific compiler warnings?

  8. 8

    How to disable Ecmascript 6 linting warnings in Visual Studio Code RC5?

  9. 9

    Showing code Warnings in Visual Studio

  10. 10

    Visual Studio 2015 Warnings not triggered

  11. 11

    Auto disable specific extension when launch visual studio?

  12. 12

    Disable disclosure triangle next to files in Visual Studio Solution Explorer

  13. 13

    How to disable MSI logging files presumably being generated by Visual Studio

  14. 14

    Disable automatic commit of changed files in Visual Studio 2013 to git

  15. 15

    Disable disclosure triangle next to files in Visual Studio Solution Explorer

  16. 16

    Temporarily disable warnings on specific versions of GCC

  17. 17

    Disable specific warnings in Stack build --pedantic

  18. 18

    Disable bitcode with Visual Studio

  19. 19

    Disable bitcode with Visual Studio

  20. 20

    How to search within specific folders and files in Visual Studio 2010

  21. 21

    Visual Studio 2013 / Open all files of a specific extension

  22. 22

    How to generate Unreal Visual Studio solution files into specific folders

  23. 23

    Visual Studio 2013 Compiler Warnings not Showing

  24. 24

    Visual Studio 2013 not displaying unreferenced variable warnings

  25. 25

    Enable Mismatch namespace warnings in Visual Studio 2010

  26. 26

    How to suppress JSLint warnings in Visual Studio 2015

  27. 27

    Disable python warnings only for specific module via commandline

  28. 28

    Disable all warnings for specific file with premake5

  29. 29

    Disable peek in Visual Studio Code

HotTag

Archive