Reputation: 29563
I have a project created in visual studios 2010 pro, now opening it ultimate I am getting 100s of errors i belive because of fx cop.
How do I just simply turn it off.
I have right clicked and gone to code analysis, what setting do I have my website on?
EDIT:
the reason i need to turn it off because i get this main error:
Error 1 CA0060 : The indirectly-referenced assembly 'Newtonsoft.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. This assembly was referenced by: C:\CMS\packages\DataTablePager\DataTablePager.dll. Application
Upvotes: 5
Views: 5870
Reputation: 370
Add <RunCodeAnalysis>false</RunCodeAnalysis>
to your .csproj files (I slapped it in the first <PropertyGroup>
I could find) and stop using Analyze > Run Code Analysis
because that still runs the old FxCop.
If you use the old ASP.NET (not Core), right click on a project and click Unload project
before you can edit the .csproj.
Source: https://learn.microsoft.com/en-us/visualstudio/code-quality/fxcop-analyzers-faq?view=vs-2019
Upvotes: 2
Reputation: 25694
Right click on your project node in Solution Explorer, choose Properties.
There is a Code Analysis tab near the bottom. Click that and uncheck "Enable Code Analysis on Build".
Alternatively, you could right click on that error, and choose "Suppress". This will allow you to suppress that error from being generated.
Upvotes: 9