类型或名称空间名称"x"在名称空间中不存在 [英] The type or namespace name 'x' does not exist in the namespace
问题描述
大家好
我正在尝试使用下面的代码调用WCF服务,但我收到一条错误消息,提示:类型或名称空间名称"WCFCarService"在名称空间"SilverlightCarServiceClient.WCFSilverlightReference"中不存在(您是否缺少程序集参考?)
我也尝试将其添加为参考,并且Silverlight不接受要在silverlight之外创建的项目.
public MainPage()
{
InitializeComponent();
SilverlightCarServiceClient.WCFSilverlightReference.WCFCarService client = 新 SilverlightCarServiceClient.WCFSilverlightReference.WCFCarService();
添加的服务参考是WCFSilverReference.
请帮忙.
谢谢
TB
您是否可以查看Web服务的SOAP消息以首先查看消息中是否存在"WCFCarService
"? /blockquote>
您是否正确创建了Web服务?如果要执行WCF服务,则必须首先创建.net Web服务,然后在该项目中,必须创建与Silverlight兼容的WCF服务.
Hello Guys
I am trying to call my WCF Service using the code below but I am getting error message which says: The type or namespace name ''WCFCarService'' does not exist in the namespace ''SilverlightCarServiceClient.WCFSilverlightReference'' (are you missing an assembly reference?)
I have also tried to add it as reference and Silverlight does not accept projects created outside silverlight to be added.
public MainPage() { InitializeComponent(); SilverlightCarServiceClient.WCFSilverlightReference.WCFCarService client = new SilverlightCarServiceClient.WCFSilverlightReference.WCFCarService();
The service reference added is WCFSilverReference.
Please help.
Thanks
TB解决方案Can you have a look at SOAP message of the web service to see if ''WCFCarService
'' exists within the message in the first place?
Did you create your web service correctly? If you''re doing a WCF service, you have to first create a .net web service, and then within that project, you have to create a Silverlight-compatible WCF service.
这篇关于类型或名称空间名称"x"在名称空间中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!