UWP - class PhoneLine not found [duplicate]

百般思念 提交于 2019-12-04 04:25:57

问题


I'm trying to make phone calls from my application. I'm supposed to use PhoneLine from namespace Windows.ApplicationModel.Calls;. But PhoneLine is not in Windows.ApplicationModel.Calls;, however according to documentation it should be there. When I add it to source code like Windows.ApplicationModel.Calls.PhoneLine this and hover over it, there is a hint saying:

The type name 'PhoneLine' could not be found in the namespace 'Windows.ApplicationModel.Calls'. This type has been forwarded to assembly 'Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublickKeyToken=null, ContentType=WindowsRuntime'. Consider adding a reference to that assembly.

So I tried to access PhoneLine through Windows.Foundation.UniversalApiContract', but VS says that PhoneLine does not exist in Windows.Foundation.UniversalApiContract eighter.

I have checked Phone Call and VOIP Calls in app manifest with no success. Can you help me with that? Thanks.


回答1:


You have to include Windows Mobile Extensions for the UWP. Just add a new reference and go into Univerval Windows/Extensions.

If needed, you can find the following sample on github : https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/PhoneCall



来源:https://stackoverflow.com/questions/36824967/uwp-class-phoneline-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!