My MS Visual C# program was compiling and running just fine. I close MS Visual C# to go off and do other things in life.
I reopen it and (before doing anything else)
What worked for me: Close MS Visual Studio, then start Visual Studio and open the solution. The error message was then gone.