Getting a script compile error

I am getting an error when I try to build my project. It says Error building Player because scripts have compile errors in the editor. However, they do not have any errors. How do I fix this?

It happens when I create a UdpClient.
I am getting The type or namespace name UdpClient could not be found.