简体   繁体   English

仅在一台PC上例外,在其他PC上工作正常

[英]Exception only in one PC, in others work fine

I have an exception only in one PC, in others all work fine, anyone know wher it is comming from? 我只有一台PC例外,在其他PC上一切正常,有人知道它是怎么来的吗?

dditional information: Requested Windows Runtime type 'Windows.Media.Capture.MediaCapture' is not registered. 附加信息:请求的Windows运行时类型'Windows.Media.Capture.MediaCapture'未注册。

This exception is showing only in modern style apps (windows strore app) in windows 8.1. 仅在Windows 8.1中的现代风格应用程序(Windows strore应用程序)中显示此例外。 In WPF or Windows Form apps camera works fine. 在WPF或Windows Form应用程序中,相机可以正常工作。 Code is fine, because in other pc work great:) i install system one more time, but the exception still showing up. 代码很好,因为在其他PC上效果很好:)我又安装了一次系统,但仍然显示异常。

Looking at Microsoft's Windows Universal Samples ( https://github.com/Microsoft/Windows-universal-samples/blob/e13cf5dca497ad661706d150a154830666913be4/Samples/SpeechRecognitionAndSynthesis/cs/AudioCapturePermissions.cs#L35 ) shows following piece of code 查看Microsoft的Windows通用示例( https://github.com/Microsoft/Windows-universal-samples/blob/e13cf5dca497ad661706d150a154830666913be4/Samples/SpeechRecognitionAndSynthesis/cs/AudioCapturePermissions.cs#L35 )显示以下代码

try
{
    // Request access to the microphone only, to limit the number of capabilities we need
    // to request in the package manifest.
    MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings();
    settings.StreamingCaptureMode = StreamingCaptureMode.Audio;
    settings.MediaCategory = MediaCategory.Speech;
    MediaCapture capture = new MediaCapture();

    await capture.InitializeAsync(settings);
}
catch (TypeLoadException)
{
    // On SKUs without media player (eg, the N SKUs), we may not have access to the Windows.Media.Capture
    // namespace unless the media player pack is installed. Handle this gracefully.
    var messageDialog = new Windows.UI.Popups.MessageDialog("Media player components are unavailable.");
    await messageDialog.ShowAsync();
    return false;
}

So you have to install "Media player components". 因此,您必须安装“媒体播放器组件”。

I just had this issue with Windows 10. I had installed the N edition, but it looks like since it is missing Media Player, the classes related to MediaCapture are also missing. 我刚刚在Windows 10上遇到了这个问题。我已经安装了N版本,但是由于缺少Media Player,因此看起来像MediaCapture相关的类也丢失了。 As Hans Passant mentioned, the MediaCapture class was not registered in HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\WindowsRuntime\\ActivatableClassId. 正如Hans Passant所述,MediaCapture类未在HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ WindowsRuntime \\ ActivatableClassId中注册。

I reinstalled Window 10 (not the N edition) and now the class is registered. 我重新安装了Windows 10(不是N版本),现在注册了该类。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么这个数据库更新只在一台客户端电脑上什么都不做,而在其他几台电脑上却能正常工作? - Why this database update does nothing only in one client pc and works fine on several others? Volusion API服务可在一台PC上运行,但不能在其他PC上运行 - Volusion API service works on one PC but no others 一台PC接收到WCF回调,而另外两台则错过了 - WCF callbacks received by one PC and missed on two others 我的应用程序拒绝了MySQL Access,但其他应用程序正常运行 - MySQL Access denied for my application, but others work fine 一个参数值从字面上进行更新,但其他参数可以正常使用C# - One Parameter Value is Updated Literally But Others Works Fine C# 模型在一个视图中工作正常,但在另一个视图中引发异常 - Model is working fine in one view, but throwing an exception in another one Unity TCP / IP服务器仅接受本地连接。 同一台PC上的同一代码不在Unity上正常工作 - Unity TCP/IP server accepts only local connections. Same code on same PC not on Unity works fine Csharp 应用程序仅适用于我的电脑 Visual Studio 2019 - Csharp app only work on my pc Visual Studio 2019 为什么WinForms上的DataBinding不能在我的一种表单上起作用,而在其他表单上起作用? - Why does DataBinding on WinForms not work on one of my forms but on the others? 仅在接收数据时出现 IPC 反序列化异常? 发送工作正常 - IPC deserialization exception only on recieving data? Sending works fine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM