I have this code where I attempt to get the remote endpoint IP address from a WCF Service for debugging/logging:
var endpoint = (RemoteEndpointMessageProperty)OperationContext.Current?.IncomingMessageProperties?[RemoteEndpointMessageProperty.Name];
The ? conditional element access triggers the above mentioned rule:
However, looking at the reference sources, it seems that IncomingMessageProperties could very well be null:
public MessageProperties IncomingMessageProperties
Message message = this.clientReply ?? this.request;
if (message != null)
Is this a bug or am I missing something?