I got that error with this code:
const string body = HighPoint; // HighPoint is a string arg passed in to the method
…and was able to work around it by removing the constant:
string body = HighPoint;
…or, of course, assigning a constant value:
const string body = "My Dinner with Andre";
…but is “my way not a very sporting way”? (gratuitous Princess Bride reference)
The keyword
constin C# means a compile-time constant. It is different from C++ and C, where the same keyword requires only a run-time const-ness.