This is the online documentation for PostSharp 5.0.
Download PDF or CHM. Go to v4.3 or v5.0

IValidableAnnotation.CompileTimeValidate Method

Method invoked at build time to ensure that the aspect has been applied to the right target.

Namespace:  PostSharp.Extensibility
Assembly:  PostSharp (in PostSharp.dll) Version: (
bool CompileTimeValidate(
	Object target


Type: System.Object
Target element.

Return Value

Type: Boolean
true if the aspect was applied to an acceptable target, otherwise false.
The implementation of this method is expected to emit an error message or an exception of type InvalidAnnotationException in case of error. Only returning false causes the aspect to be silently ignored.
See Also