User Tools

Site Tools

blog:2024-10-18-001



2024-10-18 Share: CS1106 Extension method must be defined in a non-generic static class

Answers

  • public void MoveTo(this Image target, double newY)
  • this on the first argument of a method definition indicates an extension method which, as the error message says, only makes sense on a non-generic static class. Your class isn't static.
  • This doesn't seem to be something that makes sense as an extension method, since it's acting on the instance in question, so remove the this.

TAGS

  • 14 person(s) visited this page until now.

Permalink blog/2024-10-18-001.txt · Last modified: 2024/10/18 13:08 by jethro

oeffentlich