Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The provided URI scheme 'file' is invalid expected 'http'

I created a small Silverlight 4.0 / RIA Services application and tested it. I developed the app on a machine at home and needed to move it to the production domain at work. I did this by pushng it to the source repository and then cloning it to a dev machine at work. It builds without an error in both locations.

The problem occurs when I attempt to debug in the new location. At the first 'Load()' method on the domain context I get the following error:

The provided URI scheme 'file' is invalid expected 'http'

I get that the debugger is attempting to run with file based URI rather than an HTTP URI. But, why? And how do I fix it?

Searching through SO returned some similar errors regarding invalid URI schemes, but non of them helped me with this specific issue.

Thanks, Jim

like image 807
Jim Reineri Avatar asked Oct 12 '10 21:10

Jim Reineri


3 Answers

Make sure your startup project is the web project, and not the Silverlight project itself.

like image 74
Martin Doms Avatar answered Nov 19 '22 14:11

Martin Doms


What is probably happening is that the Silverlight client application is trying to communicate with the server-side RIA Services web service using a "file://" protocol.
Have you launched the Silverlight XAP file directly from the file system of the server instead of through a 'http://" URL? Silverlight is trying to use the same protocol as the one used to get its XAP file.
For the same reason, when launching the application from Visual Studio, set the Web project as the startup project instead of the Silverlight (client) project.

like image 1
ZunTzu Avatar answered Nov 19 '22 16:11

ZunTzu


If you are running OOB (Out Of Browser) and want to debug, then you need to set your Silverlight client project as the start up project, also within the server project, right click on your '*TestPage.html' and 'Set as Start Page'. Then, if you get the error...

The provided URI scheme 'file' is invalid expected 'http'

Then open the properties page of the Silverlight client and UNCHECK "Enable running application out of the browser", click Save and then CHECK the setting back on and it should work. see... http://blogs.msdn.com/b/deepm/archive/2010/07/16/debugging-an-oob-silverlight-business-application.aspx

like image 1
tkerwood Avatar answered Nov 19 '22 15:11

tkerwood