The c# was not connected to my arduino hardware.

I am guessing that the Arduino is on COM25 and he’s trying to connect to it from a program on his PC… But his Arduino code doesn’t have Serial enabled.

Add

Serial.begin(9600);

To the Arduino setup code.