开发者

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 s开发者_如何学Come similar errors regarding invalid URI schemes, but non of them helped me with this specific issue.

Thanks, Jim


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


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.


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


I am pretty sure you are supposed to reference a server side file, not a local file. Additionally most Silverlight applications are not allowed to access local files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜