Overview

PostSharp comes with a command-line utility named postsharp.exe. The most common way to invoke PostSharp is to run this utility. By default, PostSharp targets for MSBuild invoke this utility.

Basically, you always execute a given PostSharp project against a given assembly, and you pass properties to the PostSharp project.

You might find useful to read more about  PostSharp projects, PostSharp properties, and PostSharp search path.

Usage

 

postsharp.exe [<options>] <project> <input> [<options>]

Where:

The following options are supported:

Option Description
/P:name=value Sets a property.
/Attach Gives the opportunity to attach a debugger to the process.
/SkipAutoUpdate Does not display a warning when a new version is available.

The following options allow you to run unit tests of custom plug-ins; thanks to them, you can check that PostSharp emits exactly the expected errors or warnings.

Option Description
/U Fails on unexpected messages, even on information or warning messages.
/E:messageId Expects a message to be emitted (the program will fail if not emitted).
/D:messageId Disables a message.