As multiple people in the comments suggested, you are probably missing a using directive. More specifically using System;.