2013-10-15 51 views
6

當我嘗試獲取可用音頻設備列表時,無法從Lync 2013獲取可用音頻設備sdk

LyncClient client = LyncClient.GetClient(); 
foreach (Device dev in client.DeviceManager.AudioDevices) 
{ 
     //Do something 
} 

我得到的錯誤Exception has been thrown by the target of an invocation.

"Unable to cast COM object of type 'System.__ComObject' to interface type 
'Microsoft.Office.Uc.IAudioDevice2'. This operation failed because the QueryInterface 
call on the COM component for the interface with IID '{86B3E5FE-4635-4C1E- 
A725-C80B71D04984}' failed due to the following error: No such interface supported 
(Exception from HRESULT: 0x80004002 (E_NOINTERFACE))." 

這裏是堆棧跟蹤

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) 
at Microsoft.Lync.Model.Internal.UCWCache.CreateUCW(Object source, CCOMInfo ccomInfo) 
at Microsoft.Lync.Model.Internal.UCWCache.GetITTargetNS(Object source) 
at Microsoft.Lync.Model.Internal.UCEnumerator`2.get_Current() 
at Microsoft.Lync.Model.Internal.UCEnumerator`2.System.Collections.Generic.IEnumerator<S>.get_Current() 

和內部異常堆棧跟蹤

at Microsoft.Lync.Model.Device.AudioDevice.INTERNAL_Init(IAudioDevice initInterface) 
at Microsoft.Lync.Model.Device.AudioDevice.INTERNAL_Init_Object(Object initInterface) 
+0

我有同樣的問題,您可以請發佈解決此問題的版本(sdk和Lync Client 2013)。 – Anas

+0

對不起,延遲迴復。我使用這個版本的Lync http://support.microsoft.com/kb/2825630。和這個版本的sdk http://www.microsoft.com/en-ca/download/confirmation.aspx?id=36824 – user1098580

回答

1

您是否檢查過Lync和SDK的版本號是否相同?

Lync 2013似乎有許多版本,並且它們可能版本不同。

0

問題似乎是在「//做omething「代碼的一部分。

我只是跑他跟着罰款。

var Client = LyncClient.GetClient(); 

     foreach (var dev in Client.DeviceManager.AudioDevices) 
     {    
      Console.WriteLine(dev.Name); 
     } 

如果這不起作用的話,任何機會的堆棧跟蹤?

+0

當它試圖影響dev變量時,foreach本身發生錯誤。我添加了堆棧跟蹤。 – user1098580

相關問題