PostSharp 6.10 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Contracts Namespace / Location­Contract­Attribute Class / Location­Contract­Attribute Properties / Location­Contract­Attribute.​Error­Message Property

LocationContractAttribute.ErrorMessage Property

Note: This API is now obsolete.

Gets or sets the error message formatting string.

Namespace:  PostSharp.Patterns.Contracts
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: (
[ObsoleteAttribute("Use ContractExceptionFactory and ContractLocalizedTextProvider to generate error messages.")]
public string ErrorMessage { get; set; }

Property Value

Type: String

See remarks on LocationContractAttribute for information about message parameters.

If the value of this property is set to

Property Value

Type: String
null, GetErrorMessage() will be used to obtain the error message.

Set this property only for legacy purposes. Otherwise, use GetErrorMessage() method.

See Also