A lot of these answers are referring to the Nuget packages and/or cleaning and reloading your project.
If you have WCF service references and invalid endpoints, you can also get this error message. Make sure your endpoints are correct and update the service configuration with the correct endpoint in the .config and when you configure the service reference from the GUI.