C# Giving Up on const for use in non-static context

c#

Solution

I just figured out why. I was referring to the variable as `this.someString`. The error went away after I switched to `MyClass.someString`.

Problem

I have the following readonly string in my C# class. ``` private readonly string someString= "I am a string."; ``` I feel the urge to convert this to a `const` because the information is available at compile time. However, I have it as `readonly` because I am using it in a non-static context. Is this the right thing to do? Or am I having an issue with my code design?

Original source

Related problems