1 错误提示:提供的 URI 方案“file”无效;应为“http”
网上的一个方法链接:/robin022/article/details/6439965
说是将项目的启动项改为SL中的WEB项目即可,还有一种情况可能是你的WEB项目中没有引用wcf ria library中相应的web项目。增加引用即可。
但我仍然还遇到了一种情况,表示无力吐槽,客户端SilverLight项目:Shell 服务端SilverLight项目:Shell.Web.右击Shell,属性-调试-启动操作-浏览器外应用程序,先改为Shell,然后运行项目。项目报错后再将属性-调试-启动操作-浏览器外应用程序改为Shell.Web项目,然后再运行就不会报这种错误了。
2 错误提示:Invoke 操作“Name”失败。远程服务器返回了错误: NotFound。 类似这样的提示,找不到wcf ria library中的方法:
错误信息: System.ServiceModel.DomainServices.Client.DomainOperationException: Invoke 操作“Name”失败。远程服务器返回了错误: NotFound。 ---> municationException: 远程服务器返回了错误: NotFound。 ---> .WebException: 远程服务器返回了错误: NotFound。 ---> .WebException: 远程服务器返回了错误: NotFound。
原因,要在web.config中增加以下结点:
<configuration><system.web><compilation debug="true" targetFramework="4.0" /><httpModules><add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></httpModules></system.web><system.serviceModel><serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /></system.serviceModel></configuration>