TraceListener.TraceEvent and NotNull

The overloads of TraceListener.TraceEvent have the NotNull attribute applied to the "message" or "format" and "args" parameters as appropriate. However, while TraceSource.TraceEvent does not allow null as an argument to these parameters, Trace.TraceError (and other similar methods) DOES allow null as an argument, and will pass null to TraceListener.TraceEvent. All of the built-in subclasses of TraceListener explicitly check for null; however, checking for null in my own subclass of TraceListener results in a Resharper warning that "expression will always be false". I believe the NotNull attribute on these parameters needs to be removed.

Please sign in to leave a comment.