Thursday, September 23, 2010

Invalid URI scheme 'file://' for map control. Control must be hosted in a HTTP(s) website.

But... I'm not using file:// for my map control.

So, I'm programming with ESRI's Silverlight Map control. This started out as a test project, but it's become more of a production application. Instead of moving all my code to a new project, I'll just rename it from SilverlightApplication1 to MyProdcutionApplication.

I rename all the namespaces, remembering to rename the corresponding XAML references that don't get refactored. Then I rename the projects themselves and have to organize the folders.

So, I remove all the projects from the solution, rename the folders, and add them back in. I hit compile and woohoo, no errors. So, I go to run it and I get the following gem:

I recheck my map references and sure enough, I <am> using http://path/to/my/rest/endpoint ... so.. off to google.

After a 20 minute search trying all variations of the error, I finally stumble upon this thread in the ESRI forums. Back in 2009, Don Freeman got the same error and lo and behold, it was because the default start project was the Silverlight Application, not the Test Website.

I flipped my startup project to the test web app and poof... all is well

1 comment:

  1. page in the web project to the solution of this error, change the start page of the project