C# CoreAudioApi.dll在某些计算机上引发COMException
我必须添加一个功能,允许用户从应用程序中修改系统卷。为此,我使用了本网站其他问题中提到的C# CoreAudioApi.dll在某些计算机上引发COMException,c#,visual-studio,windows-7,core-audio,C#,Visual Studio,Windows 7,Core Audio,我必须添加一个功能,允许用户从应用程序中修改系统卷。为此,我使用了本网站其他问题中提到的CoreAudioApi.dll e、 g 我添加了对CoreAudioApi.dll的引用 这在我的开发计算机上运行良好,但是,当应用程序在其他人的计算机上运行时(例如,测试它的人),我们会遇到以下异常: A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in CoreAudioAp
CoreAudioApi.dll
e、 g
我添加了对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
两台电脑都运行64位Windows 7
你知道是什么原因造成的吗?它是否引用了另一个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);
调试器尝试输入
ServiceLocatorImplBase.cs
(如果信息有任何帮助)像往常一样,我花了几个小时看东西,发布问题,然后它直接击中我
另一台计算机的音频硬件似乎依赖于扬声器或耳机的插入,甚至在它自己启动之前。他们不是。(由于我们的应用程序还没有添加声音,他依靠目视检查Windows音量混合器来测试。)当其他用户插入耳机时,一切正常
我可以通过禁用音频硬件在自己的电脑上重现该问题。看起来我只需要处理这个异常并在这种情况下禁用UI控件。其他用户是他们机器上的管理员吗?@BugFinder-我已经要求他们尝试以管理员的身份运行,这没有什么区别。