ReSharper 2026.1 Help

Code inspection: The CallerFilePathAttribute will have no effect; it is overridden by the CallerLineNumberAttribute

This inspection reports a parameter marked with both [CallerFilePath] and [CallerLineNumber]. [CallerLineNumber] overrides [CallerFilePath] on the same parameter, so the file path attribute has no effect and only makes the code misleading.

Example

using System.Runtime.CompilerServices; void Log([CallerFilePath, CallerLineNumber] object info = null) { }
using System.Runtime.CompilerServices; void Log([CallerLineNumber] object info = null) { }

How to fix

There is no dedicated quick-fix. The usual fix is to remove the overridden attribute.

21 April 2026