ReSharper 2026.1 Help

Code inspection: 'with' expression modifies all accessible instance members

This inspection reports with expressions that assign all accessible instance members of the cloned value. When every member is overwritten, the original value is not really being reused anymore. In that case, a new object, tuple, or record value is usually clearer than cloning and replacing everything.

Example

var updated = point with { X = 10, Y = 20 }; record Point(int X, int Y);
var updated = new Point(10, 20); record Point(int X, int Y);

Quick-fix

Replace the clone with a new value that directly contains the final state.

01 April 2026