Windows Phone 8 服务调用导致错误 HRESULT E_FAIL 已从对 COM 组件的调用返回 [英] Windows Phone 8 Service Call causes Error HRESULT E_FAIL has been returned from a call to a COM component

查看:32
本文介绍了Windows Phone 8 服务调用导致错误 HRESULT E_FAIL 已从对 COM 组件的调用返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在进行典型的服务调用时,会导致错误 HRESULT E_FAIL 已从对 COM 组件的调用返回

When making a typical Service Call it is causing an error Error HRESULT E_FAIL has been returned from a call to a COM component

var response = await ServiceManager.SendRequestAsync<GetOptionsResponse>(request);

此错误仅在我从此页面进行服务调用时发生,如果我从另一个页面调用相同的方法,则它工作正常.

This error is only occurring when I make a service call from this page, if I call the same method from another page it works fine.

错误导致不返回响应,整个应用程序崩溃.

The error causes the response to not be returned and the whole App crashes.

有什么想法吗?

推荐答案

事实证明,它实际上不是服务调用,只是等待允许的任何方法,主 UI 线程返回加载页面.

It turns out that it actually wasn't the Service Call, just any method that was awaited allowing, the Main UI thread to return to loading the Page.

加载页面时,XAML 中出现错误,导致整个应用程序崩溃.

When the page was loaded there was an error in the XAML that caused the entire App to Crash.

原来是 xaml 中的这一行

Turns out it was this line in the xaml

FontWeight=" {Binding Path=SatisfactionSurveyStyles.SelectedListBoxItemFontWeight,Source={StaticResource LocalizationFiles}}"

FontWeight=" {Binding Path=SatisfactionSurveyStyles.SelectedListBoxItemFontWeight, Source={StaticResource LocalizationFiles}}"

" {

FontWeight="{Binding Path=SatisfactionSurveyStyles.SelectedListBoxItemFontWeight,Source={StaticResource LocalizationFiles}}"

FontWeight="{Binding Path=SatisfactionSurveyStyles.SelectedListBoxItemFontWeight, Source={StaticResource LocalizationFiles}}"

我删除了空间,现在工作正常,因为编译器没有发现 XAML 错误,所以很难追踪,而且微软在我阅读时会误导错误消息而臭名昭著

I removed the space and it works fine now, since XAML errors aren't picked up by the Compiler it was hard to track down, also since Microsoft is notorious for misleading Error Messages when I read

调用 COM 组件时返回了错误 HRESULT E_FAIL

Error HRESULT E_FAIL has been returned from a call to a COM component

这不是很有帮助.无论如何它现在有效,吸取教训,空间可能是致命的......>)

It wasn't very helpful. Anyways it works now, lesson learned, spaces can be deadly... >)

这篇关于Windows Phone 8 服务调用导致错误 HRESULT E_FAIL 已从对 COM 组件的调用返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆