2013-10-15 4 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

ある問題であるように思われます"// Do sコードの一部である "omething"

私はちょうど彼の次の罰金を実行しました。

var Client = LyncClient.GetClient(); 

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

これが機能しない場合、スタックトレースが発生しますか?

+0

エラーは、dev変数に影響を与えるしようとすると、foreach自体の内部で発生します。スタックトレースを追加しました。 – user1098580

関連する問題