Code inspection: Backing field is used but never assigned
This inspection reports a property that reads from the synthesized backing field via field, but never assigns it. That means the property is reading an uninitialized backing value instead of real state.
Example
public class Settings
{
public int Port
{
get
{
return field;
}
}
}
public class Settings
{
public int Port
{
get
{
return 8080;
}
}
}
How to fix
This inspection does not have a dedicated quick-fix. The fix is to either provide a literal return value, or add a setter or initializer that really assigns the backing field.
01 April 2026