If you are using Silverlight RIA Services application, you might get this error sometimes. Simple reason is you have set the Silverlight application as a Startup project. When Silverlight project is startup project it will generate a test html page and loads it from file system rather than in http mode. So simple fix is to set the Website that hosts the RIA context as startup project!
Simple isn’t it