Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable warnings for specific files in Visual Studio

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
like image 264
Dominik Palo Avatar asked Mar 26 '15 14:03

Dominik Palo


1 Answers

Late, but the most obvious is to place in the top of the file

#pragma warning disable warning-list
like image 135
panpawel Avatar answered Sep 30 '22 16:09

panpawel