Code inspection: Cannot access static symbol in text argument
Some frameworks use string literals to refer to code symbols such as fields, properties, or methods. A static member cannot always be used in places that expect an instance member. This inspection reports a string-based symbol reference when the referenced symbol is static but the target context requires an instance member.
Example
class Person
{
public static string FullName => "John Smith";
}
// The string is expected to point to an instance member.
[SomeFrameworkAttribute("FullName")]
class Example
{
}
class Person
{
public string FullName => "John Smith";
}
[SomeFrameworkAttribute("FullName")]
class Example
{
}
01 April 2026