SecAnnotate.exe (.NET Security Annotator Tool)
The .NET Security Annotator tool (SecAnnotate.exe) is a command-line application that identifies the SecurityCritical
and SecuritySafeCritical
portions of one or more assemblies.
A Visual Studio extension, Security Annotator, provides a graphical user interface to SecAnnotate.exe and enables you to run the tool from Visual Studio.
This tool is automatically installed with Visual Studio. To run the tool, use Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell.
At the command prompt, type the following, where parameters are described in the following section, and assemblies consist of one or more assembly names separated by blanks:
Syntax
SecAnnotate.exe [parameters] [assemblies]
Parameters
Option | Description |
---|---|
/a or /showstatistics |
Shows statistics about the use of transparency in assemblies that are being analyzed. |
/d: directoryor /referencedir: directory |
Specifies a directory to search for dependent assemblies during annotation. |
/i or /includesignatures |
Includes extended signature information in the annotation report file. |
/n or /nogac |
Suppresses searching for referenced assemblies in the global assembly cache. |
/o: output.xmlor /out: output.xml |
Specifies the output annotation file. |
/p: maxpassesor /maximumpasses: maxpasses |
Specifies the maximum number of annotation passes to make on assemblies before stopping the generation of new annotations. |
/q or /quiet |
Specifies quiet mode, in which the annotator does not output status messages; it outputs only error information. |
/r: assemblyor /referenceassembly: assembly |
Includes the specified assembly when resolving dependent assemblies during annotation. Reference assemblies are given priority over assemblies that are found in the reference path. |
/s: rulenameor /suppressrule: rulename |
Suppresses running the specified transparency rule on the input assemblies. |
/t or /forcetransparent |
Forces the Annotator tool to treat all assemblies that do not have any transparency annotations as if they were entirely transparent. |
/t :assemblyor /forcetransparent :assembly |
Force the given assembly to be transparent, regardless of its current assembly-level annotations. |
/v or /verify |
Verifies only that an assembly's annotations are correct; does not attempt to make multiple passes to find all required annotations if the assembly does not verify. |
/x or /verbose |
Specifies verbose output while annotating. |
/y: directoryor /symbolpath: directory |
Includes the specified directory when searching for symbol files during annotation. |
Remarks
Parameters and assemblies may also be provided in a response file that is specified on the command line and prefixed with an at sign (@). Each line in the response file should contain a single parameter or assembly name.
For more information about the .NET Security Annotator, see the entry Using SecAnnotate to Analyze Your Assemblies for Transparency Violations in the .NET Security blog.