我必须添加一项功能,允许用户从应用程序中修改系统卷。为此,我已使用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