PostSharp SDK 2023.0 / / Class Reference / Post­Sharp.​Extensibility Namespace / Message­Location­Extensions Class / Message­Location­Extensions Methods / Message­Location­Extensions.​Write Method / Message­Location­Extensions.​Write Method (Message­Source, Sym­Aspect­Instance, Severity­Type, String, Object[])

MessageLocationExtensions.Write Method (MessageSource, SymAspectInstance, SeverityType, String, Object[])

Emits a Message.

Namespace:  PostSharp.Extensibility
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
Syntax
C#
public static void Write(
	this MessageSource messageSource,
	SymAspectInstance codeElement,
	SeverityType severity,
	string messageId,
	params Object[] arguments
)

Parameters

messageSource
Type: MessageSource
A MessageSource.
codeElement
Type: PostSharp.Sdk.WeavingSymbols.SymAspectInstance
Source code artifact that caused the message.
severity
Type: SeverityType
Message severity (fatal error, error, info, debug).
messageId
Type: System.String
Identifier of the message type.
arguments
Type: System.Object[]
Array of arguments used to format the message text, or null if this message has no argument.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type MessageSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also