【发布时间】:2010-03-25 22:25:35
【问题描述】:
silverlight 应用程序运行,但是当它调用我得到的服务时:
运行过程中出现异常,导致结果无效。检查 InnerException 以获取异常详细信息。 在 System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() 在 SalesSimplicityPO_SL.POSvc.GetPurchaseOrdersCompletedEventArgs.get_Result() 在 SalesSimplicityPO_SL.About.mySvc_GetPurchaseOrdersCompleted(对象发送者,GetPurchaseOrdersCompletedEventArgs e) 在 SalesSimplicityPO_SL.POSvc.POSvcClient.OnGetPurchaseOrdersCompleted(对象状态)
我加载并调用我的网络服务,例如..
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress(new Uri("http://localhost/POSystem/POSvc.svc"));
POSvc.POSvcClient mySvc = new POSvc.POSvcClient(binding, address);
mySvc.InsertPOCompleted += new EventHandler<SalesSimplicityPO_SL.POSvc.InsertPOCompletedEventArgs>(mySvc_InsertPOCompleted);
mySvc.InsertPOAsync(InitialsTextBox.Text.ToString(), DescTextBox.Text.ToString(), ClientTextBox.Text.ToString());
在调试中效果很好......
我做错了什么来得到这个错误?
更新:
我真的不明白为什么它修复了它,但这修复了它..也许有人可以提供一些信息......
我变了
EndpointAddress address = new EndpointAddress(new Uri("http://localhost/POSystem/POSvc.svc"));
到
EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "../POSvc.svc"));
【问题讨论】:
-
你
Check InnerException for exception details了吗? -
哈哈,除非我是个白痴(这是可能的......),这是内部异常在上面..它以 System.ComponentModel.AsyncCompletedEventArgs 开头......
-
这是外部异常,位于 EventArgs 的
Error属性中。检查e.Error.InnerException。 -
好吧,现在说得通了.. 提出了更多问题,但这就是它的美妙之处,好吗?谢谢
标签: c# silverlight wcf deployment