5

I've tried to compile .NET project and this CA appears, however I can't find any information about it on MSDN, do you know how to fix it?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Steve Macculan
  • 2,292
  • 5
  • 22
  • 32

2 Answers2

0

The documentation can be found here:

Rule Description

To use security critical types, the code that references the type must be either security critical or security safe critical. This is true even if the reference is indirect. For example, when you reference a transparent field that has a critical type, your code must be either security critical or security safe. Therefore, having a security transparent or security safe critical field is misleading because transparent code will still be unable to access the field.

How to Fix Violations

To fix a violation of this rule, mark the field with the SecurityCriticalAttribute attribute, or make the type that is referenced by the field with security transparent or safe critical.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
0

In the Error List you can click the underlines CA2151 link or right click the line and select Show Error Help. Both actions will launch the MSDN overview of code analysis violations. From here you can find a link to the description of CA2151 and how to fix it.

enter image description here

Tore Østergaard
  • 4,362
  • 3
  • 27
  • 43