我必須添加一項功能,允許用戶從應用程序中修改系統卷。爲此,我已使用CoreAudioApi.dll
作爲本網站其他問題中引用的內容。CoreAudioApi.dll在某些計算機上拋出COMException
例如How to programmatically set the system volume?
我已經加入到CoreAudioApi.dll
參考這工作我開發的計算機上正常,但是,當應用程序是別人的計算機上運行(如人測試它),我們得到以下例外:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in CoreAudioApi.dll
A first chance exception of type 'Autofac.Core.DependencyResolutionException' occurred in Autofac.dll
A first chance exception of type 'Autofac.Core.DependencyResolutionException' occurred in Autofac.dll
A first chance exception of type 'Microsoft.Practices.ServiceLocation.ActivationException' occurred in Microsoft.Practices.ServiceLocation.dll
兩臺PC都運行Windows 7,64位。
關於什麼可能會導致此問題的任何想法?它是否引用另一個dll或可能碰巧有另一個dll或其他用戶沒有?
編輯
只是來縮小究竟發生異常......
private readonly MMDeviceEnumerator _deviceEnumerator = new MMDeviceEnumerator();
private readonly MMDevice _playbackDevice;
public SettingsViewModel()
{
// The exception occurs in the following line:
_playbackDevice = _deviceEnumerator.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia);
調試器將嘗試(在情況下的信息是任何幫助)
其他用戶是他們機器上的管理員嗎? – BugFinder
@BugFinder - 我已經要求他們嘗試以管理員身份運行,並沒有區別。 – colmde