How to stop false errors in Visual Studio?

Visual Studio keeps showing errors in the source code but it compiles fine. How do I stop this?