4

enter image description here

I am Using Visual Studio 2015, FxCop 14.0. with Custom rules, and trying to suppress message in GlobalSuppressions.cs. I have set path of the Global Suppression in Project file <PropertyGroup ..> .. .. <CodeAnalysisModuleSuppressionsFile>$(SolutionDir)\xxx\xx\xxx\GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> </PropertyGroup>

can anyone please help me fix this.

Avinash patil
  • 1,689
  • 4
  • 17
  • 39

3 Answers3

4

This means that there is already a GlobalSuppressions.cs file present, but it is not included in the project.

To resolve this, enable "Show All Files" in the solution explorer, right-click the GlobalSuppressions.cs file which should now appear, and "Include In Project".

Wim Coenen
  • 66,094
  • 13
  • 157
  • 251
  • This was the solution for me. The correct answer should be this as it is a better way then what Avinash suggested. – Exzile Jul 30 '18 at 15:56
2

I have done following steps and problem get resolved :

  1. Delete the existing GlobalSuppression.cs file from project.
  2. Clean Solution and rebuild.
  3. Now try to suppress the errors. This will create new file and will suppress all warnings.
Avinash patil
  • 1,689
  • 4
  • 17
  • 39
0

For those who stumble upon this...

The above answers did not work for me. So give them a try first but if that doesn't work here's what did it for me:

  1. Delete all GlobalSuppressions.cs files from the project
  2. Clean the solution.
  3. Select Analyze > Configure Code Analysis > For Solution
  4. Find the project with troubles and select Reset
  5. Run Code Analysis and everything should be good
CSCoder
  • 154
  • 1
  • 15