Silverlight WebRequest失败,并显示“无法识别URI前缀". [英] Silverlight WebRequest fails with "The URI prefix is not recognized"
本文介绍了Silverlight WebRequest失败,并显示“无法识别URI前缀".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Silverlight库,应该可以发出Web服务请求并接收xml响应:
I have a silverlight library that is supposed to get make a web service request and receive an xml response:
Uri uri = new Uri("http://some_server:51306/getStuff.xml?id=14");
WebRequest request = WebRequest.Create(uri);
但是,WebRequest.Create(uri)失败,但出现异常无法识别URI前缀".
However, WebRequest.Create(uri) fails with the exception "The URI prefix is not recognized".
请注意,我正在使用来自非Silverlight dll的单元测试来运行程序.我需要为该应用构建测试套件!
Note that I am running the program using a unit test from a non-silverlight dll. I need to build a test suite for the app!
有什么想法吗?
推荐答案
尝试将.Web项目设置为默认的启动项目,而不是Silverlight项目
Try setting the .Web project as the default startup project instead of the Silverlight project
这篇关于Silverlight WebRequest失败,并显示“无法识别URI前缀".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文